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 source —
stateandonSubmitfit any form library or server action - Sunset, Mint and Mono tints for the colour field, the rim and the check, 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 |
|---|---|---|---|
| heading | string | — | The headline, rendered as an <h2>. |
| text | string | — | One line under the headline. |
| cta | string | 'Join the waitlist' | The button label. |
| mode | 'email' | 'button' | 'email' | An email field with a button, or a single button. Below 470px of width the email row stacks. |
| placeholder | string | 'you@company.com' | Placeholder of the email field. |
| success | string | 'You’re on the list. We’ll be in touch.' | The confirmation line the row turns into. |
| state | 'idle' | 'loading' | 'success' | 'error' | — | Set it to drive the row while your own request runs: loading spins the button, success plays the confirmation, error shows the error line. Leave it out and a valid submit goes straight to success. |
| error | string | 'Something went wrong. Please try again.' | The line shown under the field with state="error". Validation has its own wording ("That doesn’t look like an email address…"). |
| href | string | — | Button mode: makes the button a real link. |
| size | number (px) | 54 | Height of the field and button; their type scales with it. The headline scales with the width of the section. |
| theme | 'light' | 'dark' | 'light' | White or dark glass. |
| submit (event) | CustomEvent | — | Fired once the address is valid, with detail.email. It does not bubble, so it can never be mistaken for the submit of a form around it. React: onSubmit(email). |
| press (event) | CustomEvent | — | Button mode: the button was pressed. React: onPress(). |
| reset() / value | method / property | — | el.reset() empties the row and returns it to idle; el.value reads or sets the address. React: a ref with reset(), focus(), value() and setValue(). |
| tint Pro | 'aurora' | 'sunset' | 'mint' | 'mono' | object | 'aurora' | The colour field, the rim of the field and the check bead, or a custom tint. Free build ships Aurora only. |
The component never sends the address anywhere: it checks it, fires submit and shows the state you set. Enter in the field submits and is kept away from any form around the section. The email field is a real <input type="email"> with autofill; errors are announced with role="alert" and the confirmation with role="status", and focus moves to the confirmation so keyboard users are not left on a hidden field. The colour field is plain CSS, three blurred shapes under a mask that fades on all four sides, so there is no edge to hide; it stops moving off-screen. The glass blurs whatever is behind it. Everything scales with the width of the section through container queries, from 320px up. With reduced motion the field is still and the confirmation appears at once.
More components
- Pearl Pricing
- Glass Bento
- Quote Wall
- 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
- Mesh Gradient
- Silk Waves
- Dot Field
- Plasma Orb
- Voice Wave
- Plush Buddy
- Gummy Agent
- Glass Tabbar
- Glass Menu
- 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