Tipografíatypographymaskheading
Image Masked Text
Titular de texto con máscara de recorte que deja ver una imagen o degradado de fondo.
Vista Previa en Vivo
Image Masked Text
Uso
Copia y pega este código directamente en tu componente React:
tsx
import { BackgroundClipMask } from 'react-component-kit-ui/typography';
<BackgroundClipMask>Content</BackgroundClipMask>Instalación Manual
Si no estás usando el paquete npm, crea un archivo nuevo y pega el siguiente código: src/components/BackgroundClipMask.tsx + BackgroundClipMask.css:
BackgroundClipMask.tsx
'use client';
import type { ReactNode } from 'react';
import './BackgroundClipMask.css';
/** BackgroundClipMask — ported from astro-component-kit. */
export interface BackgroundClipMaskProps {
children?: ReactNode;
}
export function BackgroundClipMask({ children }: BackgroundClipMaskProps) {
return (
<>
<h1 className="mask-txt" data-rk-519212="">{children}</h1>
</>
);
}
export default BackgroundClipMask;BackgroundClipMask.css
/* BackgroundClipMask — ported from astro-component-kit (typography/BackgroundClipMask.astro) */
.mask-txt:where([data-rk-519212]) { font-size: 8rem; font-weight: 900; background: url('https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?auto=format&fit=crop&w=1000&q=80'); background-size: cover; background-position: center; -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin: 0; line-height: 1; text-align: center; }
@media (max-width: 768px) { .mask-txt:where([data-rk-519212]) { font-size: 4rem; } }Información Rápida
- Categoría
- Tipografía
- Nombre de archivo
BackgroundClipMask.tsx- Dependencias
- Ninguna — React + CSS puro
- Etiquetas
- typographymaskheading