Modus UI

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-border

Manual

  1. Copy the code from the component tab.
  2. Create a file at components/ui/star-border.tsx.
  3. Paste the code.

Usage

tsx
import { StarBorder } from "@/components/ui/star-border";

export default function Example() {
  return <StarBorder color="rgba(168, 85, 247, 0.8)">Premium Button</StarBorder>;
}

Props

PropTypeDefaultDescription
asReact.ElementType"button"Element to render as.
colorstring"rgba(255, 255, 255, 0.8)"Colour of the moving star.
speednumber6Seconds for one trip around the border.
thicknessnumber1Border thickness in pixels.
backgroundColorstring"hsl(var(--background))"Inner background colour.
textColorstring"hsl(var(--foreground))"Text colour.
borderColorstring"hsl(var(--border))"Colour of the static border.

Comments

  • No comments yet.