Starstream Button
Web (React)
A WebGL pill whose face carries a sideways stream of stars that stretches into streaks on hover.
A raw-WebGL pill on a drifting paper field. Inside its primary-tinted face, layers of stars stream sideways; hovering or focusing stretches them into long streaks and clicking washes the face with the page colour. Colours come from the theme tokens and update when the theme or palette changes. It fills its positioned parent, pauses when off screen or when the tab is hidden, and holds a still frame when the user prefers reduced motion.
Installation
CLI
npx @modus-ui/cli add starstream-buttonManual
- Install
framer-motion. - Copy the code from the component tab.
- Create a file at
components/ui/starstream-button.tsx. - Paste the code.
Usage
tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | "Engage" | Button text. |
onClick | ButtonHTMLAttributes["onClick"] | - | Called after the button's own click effect. |
onMouseEnter | ButtonHTMLAttributes["onMouseEnter"] | - | Called after the button's own mouse enter effect. |
onMouseLeave | ButtonHTMLAttributes["onMouseLeave"] | - | Called after the button's own mouse leave effect. |
onFocus | ButtonHTMLAttributes["onFocus"] | - | Called after the button's own focus effect. |
onBlur | ButtonHTMLAttributes["onBlur"] | - | Called after the button's own blur effect. |
Any other <button> attribute is passed through to the inner button.
Comments