Code
In context
Install · Free Web Component
One file, no dependencies. Orchid 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
- Citrine, Glacier and Midnight inks, plus custom three-colour inks
- The vanilla Web Component with every ink, a demo page, README and license
Attributes & props
| Name | Type | Default | Description |
|---|---|---|---|
| sound | boolean | off | Plays a short synthesised a drop of ink (and a tap of vibration on phones) when used. Also on for everything inside an element with data-ui-sound="on". |
| size | number (px) | 96 | Diameter of the sphere. The icon scales with it. |
| theme | 'light' | 'dark' | 'light' | Shadow and rim for light or dark pages. |
| elevation | 0..5 | 3 | How high it floats: the shadow moves away and softens. |
| speed | number | 1 | How fast the ink drifts. 0 freezes it. |
| tint Pro | 'orchid' | 'citrine' | 'glacier' | 'midnight' | 'orchid' | Ink colours. Free build ships Orchid only. |
The ink is a 3D field inside the sphere, so the ribbons fold over each other as they turn rather than sliding across a flat disc. Under the cursor the light and the highlights follow the pointer, the ink quickens and the icon drifts a little the other way, as if it hung inside the glass; a press squeezes the sphere and stirs the ink. The shadow and caustic are drawn past the button's edge, so leave some room below it. Give icon-only buttons an aria-label. Reduced motion freezes the ink; without WebGL a static glass-and-ink gradient stands in. All library components on a page share one WebGL context.
More components
- Magnet Button
- Liquid Metal Button
- Firefly Button
- Pearl Button
- Prism Button
- Tide Slide
- Pearl Code
- 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
- 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
- Beam Border
- Spotlight Card
- Scratch Reveal
- Glass Sidebar
- Pearl Pagination
- Pearl Breadcrumb
- Glass Dock
- Pearl Slider
- Pearl Segmented
- Mercury Orb
- Prompt Input
- Voice Orb
- Aurora Ring
- Glass Toggle
- Pearl Loader
- Alien Face
- Liquid Carousel
- Orbit Carousel
- Deck Carousel