Code
In context
Install · Free Web Component
One file, no dependencies. Aurora 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 and the full shader source
- Sunset, Mint and Mono tints, plus custom tints from Brand Fit
- The vanilla Web Component with every tint, a demo page, README and license
Attributes & props
| Name | Type | Default | Description |
|---|---|---|---|
| theme | 'light' | 'dark' | 'light' | White satin with the tint pooling in the folds, or jewel-coloured satin falling into near-black. Also sets the text colour of the content. |
| speed | number | 1 | How fast the folds travel. 0 holds the cloth still. |
| angle | number (deg) | 24 | Direction the folds run: 0 is horizontal, 90 vertical, negative values slope the other way. |
| interactive | 'true' | 'false' | 'true' | The light swings toward the pointer and the cloth lifts a little under it. |
| tint Pro | 'aurora' | 'sunset' | 'mint' | 'mono' | object | 'aurora' | The colours of the cloth, or a custom tint. Mono is pearl satin on light and graphite on dark. Free build ships Aurora only. |
The element is a block that fills whatever size you give it — set a height, min-height or put it in a grid cell — and its children render on top, so lay them out with display: grid or flex on the element itself. A border-radius on it rounds the cloth. It is drawn at one sample per CSS pixel and capped for page-size areas, pauses off-screen and in hidden tabs, and under prefers-reduced-motion shows one still frame. Without WebGL (and before the script loads) a CSS gradient in the same colours stands in. The background is decoration: it is hidden from screen readers and never takes pointer events from your content. A fine dither keeps the long ramps from banding. Check the contrast of small text where a highlight passes under it.
More components
- Mesh Gradient
- Dot Field
- Tide Slide
- Pearl Code
- Ink Sphere
- Frost Card
- Holo Card
- Stream Text
- Lens Compare
- 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
- Plasma Orb
- Voice Wave
- Plush Buddy
- Gummy Agent
- Glass Tabbar
- Glass Menu
- Pearl Pricing
- Glass Bento
- Quote Wall
- Glass Cta
- Magnet Button
- Beam Border
- Spotlight Card
- Scratch Reveal
- 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