Skip to content
Browse docs and components

Shine Border

shine-border

A border with light running around it, for the one card or call to action that should be found first. A meteor of light with a fading tail, in any shape, pill included. Pure CSS in a server component, and it holds still for reduced motion.

Responsive

Install

$npxshadcnadd@forme/shine-border

Adds the component, its registry dependencies, and the token stylesheet you import once.

Usage

import { ShineBorder } from "@/components/forme/shine-border/shine-border";

<ShineBorder className="rounded-3xl">
  <PricingPlan recommended />
</ShineBorder>

When to use

Reach for it

  • The one element a reader should find first, like the recommended plan or the primary call to action.

Use something else

  • Several on one page. A beam only works when it is the only thing moving.
  • Status. A moving border is not an error or a warning; use the status colours.

API reference

Read from the source, so it is the API of the file you install. A prop marked * is required.

ShineBorder

A border with a beam running around it, for the one thing on the page that should be found first: the recommended plan, the primary call to action.

PropTypeDefaultDescription
durationnumber4Seconds for one lap of the beam.
borderWidthnumber2The border's thickness in pixels.
colorstring"var(--primary)"The beam's colour, as a token: var(--primary), var(--chart-3).
innerClassNamestring—Classes for the inner surface, where the content sits.

Also takes every prop of <div> attributes.

Accessibility

  • The beam is a decorative layer hidden from assistive technology; the content inside is untouched.

Motion

  • The beam turns by animating a conic gradient's start angle, so it follows any shape, a pill included, with no JavaScript.
  • Reduced motion holds the beam still, leaving a lit border.