HextaUIInputs & forms
Cult UIBg Image Texture
Text effectsregistry/default/ui/bg-image-texture.tsx
import type React from "react"
import { cn } from "@/lib/utils"
export type TextureVariant =
| "fabric-of-squares"
| "grid-noise"
| "inflicted"
| "debut-light"
| "groovepaper"
| "none"
interface BackgroundImageTextureProps {
variant?: TextureVariant
opacity?: number
className?: string
children?: React.ReactNode
}
const textureMap: Record<Exclude<TextureVariant, "none">, string> = {
"fabric-of-squares": "/textures/fabric-of-squares.png",
"grid-noise": "/textures/grid-noise.png",
inflicted: "/textures/inflicted.png",
"debut-light": "/textures/debut-light.png",
groovepaper: "/textures/groovepaper.png",
}
export function BackgroundImageTexture({
variant = "fabric-of-squares",
opacity = 0.5,
className,
children,
}: BackgroundImageTextureProps) {
const textureUrl = variant !== "none" ? textureMap[variant] : null
return (
<div className={cn("relative", className)}>
{textureUrl && (
<div
aria-hidden="true"
className="pointer-events-none absolute inset-0"
style={{
backgroundImage: `url(${textureUrl})`,
backgroundRepeat: "repeat",
opacity,
}}
/>
)}
{children && <div className="relative">{children}</div>}
</div>
)
}
HextaUIInputs & forms
HextaUIFeedback & loaders
HextaUIData display
Cult UICards
HextaUIText effects
Magic UICards
HextaUIData display
Cult UIData display
Cult UIFeedback & loaders
Magic UIMedia & 3D
Cult UIOverlays
shadcn/uiText effects
Motion PrimitivesOther
Cult UIOther
Magic UIInputs & forms