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 — the card content is ordinary children
- Sunset, Mint and Mono tints for the beam, 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 |
|---|---|---|---|
| children | elements | — | The card content. The card sizes itself to it; set a width (and a height, if you need one) on the element. |
| speed | number (s) | 6 | Seconds for one lap of the border. |
| radius | number (px) | 20 | Corner radius of the card and of the path the beam follows. 999 makes a pill. |
| beams | 1 | 2 | 1 | One comet, or two on opposite sides of the card. |
| hover | boolean | false | The beam fades in and runs only while the pointer is over the card or something inside it has focus; otherwise it waits where it stopped. |
| theme | 'light' | 'dark' | 'light' | A white card with a deep-coloured beam, or a dark card with a white-hot one. |
| tint Pro | 'aurora' | 'sunset' | 'mint' | 'mono' | object | 'aurora' | The three colours along the tail, or a custom tint. Free build ships Aurora only. |
| --bb-pad | CSS length | 22px | Padding inside the card. |
Most border beams rotate a gradient behind a mask, so the light crawls along the long sides of a wide card and whips round the short ones. This one is a stack of dashes on the border path itself, moved by a single CSS animation: the same speed and the same tail on every side, at any proportion. The script only measures the card (a ResizeObserver) and pauses the animation while it is off-screen. The glow is a blurred copy that lies outside the card and is never clipped. With reduced motion the beam stands still on the top edge.
More components
- Frost Card
- Holo Card
- Lens Compare
- 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