Star Border
Web (React)
A glowing button border animation that circles the perimeter.
A clean button with a dual-gradient beam that animates smoothly across the perimeter, utilizing Framer Motion instead of custom tailwind config.
Installation
CLI
npx @modus-ui/cli add star-borderManual
- Copy the code from the component tab.
- Create a file at
components/ui/star-border.tsx. - Paste the code.
Usage
tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
as | React.ElementType | "button" | Element to render as. |
color | string | "rgba(255, 255, 255, 0.8)" | Colour of the moving star. |
speed | number | 6 | Seconds for one trip around the border. |
thickness | number | 1 | Border thickness in pixels. |
backgroundColor | string | "hsl(var(--background))" | Inner background colour. |
textColor | string | "hsl(var(--foreground))" | Text colour. |
borderColor | string | "hsl(var(--border))" | Colour of the static border. |
Comments