Code
In context
Install · Free Web Component
One file, no dependencies. Lagoon 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 (
onConfirm,onReset, controlledconfirmed) and the full source - Ember, Mint and Mono tints, plus your own three colours as a custom tint
- The vanilla Web Component with every tint, a demo page, README and license
Attributes & props
| Name | Type | Default | Description |
|---|---|---|---|
| label | string | 'Slide to confirm' | Text in the tube. Also the accessible name. |
| done-label | string | 'Confirmed' | Text once confirmed. doneLabel in React. |
| width | number (px) | 300 | Width of the tube. In React you can also set any CSS width through style. |
| size | number (px) | 56 | Height; the bead and the text scale with it. |
| theme | 'light' | 'dark' | 'light' | A light porcelain groove or a dark one. |
| reset-after | number (s) | 0 | Goes back to the start by itself after this many seconds and fires reset. 0 keeps it confirmed. resetAfter in React. |
| confirmed | boolean | off | Set by the component when confirmed. Remove it (or call reset()) to start over; add it to show the confirmed state. |
| disabled | boolean | off | Dims it and ignores input. |
| sound | boolean | off | Soft ticks as the bead slides and a glass chime on confirm (plus a tap of vibration on phones). Also on for everything inside an element with data-ui-sound="on". |
| tint Pro | 'lagoon' | 'ember' | 'mint' | 'mono' | object | 'lagoon' | Colours of the liquid, or a custom { colors: [a, b, c] }. Free build ships Lagoon only. |
It fires confirm once, when the bead passes 90% of the way on release or touches the end. Only the bead can be dragged, so a stray tap on the tube does nothing — that is the point of the control. From the keyboard, Enter or Space confirms and the arrow keys move the bead. For an irreversible action still confirm on the server: the gesture guards against accidents, not against intent. The liquid is drawn on a small 2D canvas (no WebGL), pauses off-screen, and with reduced motion it moves only while you drag.
More components
- Pearl Code
- Pearl Dial
- Nova Rating
- Pearl Check
- Pearl Input
- Pearl Select
- Pearl Accordion
- Pearl Calendar
- Pearl Chip
- Glass Dock
- Pearl Slider
- Pearl Segmented
- Aurora Ring
- Glass Toggle
- Pearl Loader
- Ink Sphere
- Frost Card
- Holo Card
- Stream Text
- Lens Compare
- Glass Toast
- Glass Sheet
- Glass Tip
- Glass Nav
- Pearl Tabs
- Glass Command
- Halo Avatar
- Pearl Steps
- Pearl Skeleton
- Pearl Table
- 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
- Beam Border
- Spotlight Card
- Scratch Reveal
- Glass Sidebar
- Pearl Pagination
- Pearl Breadcrumb
- Liquid Metal Button
- Mercury Orb
- Prompt Input
- Voice Orb
- Firefly Button
- Pearl Button
- Alien Face
- Prism Button
- Liquid Carousel
- Orbit Carousel
- Deck Carousel