Code
In context
Install · Free Web Component
One file, no dependencies. Sweep preset, every other option included. Host it yourself so your visitors never load anything from our servers.
The shadcn command adds a typed React wrapper for you. Using the file directly? Custom elements work in React as-is; for type checking add:
Pro · React + TypeScript Pro
One payment of $4.99, yours forever. Use it in unlimited personal and commercial projects; no resale.
- React component with TypeScript types, the shared WebGL core and the GLSL source
- Rings and Facets foils, and the screen blend for foil over photos
- The vanilla Web Component with every foil, a demo page, README and license
Attributes & props
| Name | Type | Default | Description |
|---|---|---|---|
| width | number (px) | 340 | Card width; the height follows the ratio. |
| ratio | number | 1.586 | Width / height. 1.586 is a bank card; under 1 gives a portrait card. |
| theme | 'light' | 'dark' | 'light' | White porcelain or smoked card. |
| tilt | number (deg) | 12 | How far it leans toward the pointer. 0 keeps it flat. |
| strength | 0..1.5 | 1 | How strong the foil is. |
| radius | number (px) | 20 | Corner radius. |
| idle | boolean | true | Sways gently while nobody is touching it. |
| foil Pro | 'sweep' | 'rings' | 'facets' | 'sweep' | Foil pattern. Free build ships Sweep only. |
| blend Pro | 'auto' | 'screen' | 'auto' | Use screen when the card holds a photo. |
The foil is drawn over your content and blended into it, so text stays sharp. Give an element the class holo__pop and it shifts a few pixels against the tilt, as if it sat above the card. Reduced motion turns off the idle sway and the spring; the card then follows the pointer directly. Without WebGL it keeps the tilt and shows a static pastel foil. All library components on a page share one WebGL context.
More components
- Frost Card
- Lens Compare
- Beam Border
- Spotlight Card
- Scratch Reveal
- Tide Slide
- Pearl Code
- Ink Sphere
- Stream Text
- Pearl Dial
- Nova Rating
- Pearl Check
- Pearl Input
- Glass Toast
- Pearl Select
- Glass Sheet
- Pearl Accordion
- Glass Tip
- Pearl Calendar
- Glass Nav
- Pearl Tabs
- Glass Command
- Halo Avatar
- Pearl Steps
- Pearl Skeleton
- Pearl Table
- Pearl Chip
- Pearl Empty
- Roll Counter
- Glass Marquee
- Reveal Text
- Mesh Gradient
- Silk Waves
- Dot Field
- Plasma Orb
- Voice Wave
- Plush Buddy
- Gummy Agent
- Glass Tabbar
- Glass Menu
- Pearl Pricing
- Glass Bento
- Quote Wall
- Glass Cta
- Magnet Button
- Glass Sidebar
- Pearl Pagination
- Pearl Breadcrumb
- Glass Dock
- Pearl Slider
- Pearl Segmented
- Liquid Metal Button
- Mercury Orb
- Prompt Input
- Voice Orb
- Aurora Ring
- Glass Toggle
- Firefly Button
- Pearl Button
- Pearl Loader
- Alien Face
- Prism Button
- Liquid Carousel
- Orbit Carousel
- Deck Carousel
