Shine Border
Animated gradient edge that wraps any rounded container.
pnpm dlx @glinui/cli@latest add shine-borderInstallation
pnpm dlx @glinui/cli@latest add shine-borderCredits. Adapted from Magic UI (MIT, (c) Magic UI). Token colors, Web Animations gated by motion level, logical RTL direction, a glass variant and no inline styles. Attribution details.
Prefer the package?
Usage
ShineBorder differs from BorderBeam: the beam is a single travelling dot, the shine is a soft gradient that drifts around the whole edge. The parent must be `relative` and have a border radius, which the layer inherits.
Improvement over the original: no inline style object, no hardcoded black default, and the animation is removed from the DOM when motion is none or reduced.
Engines: the `engine` prop is not applicable. Looping css conic-gradient animation; not a reveal, so engines do not apply.
Variants
glinr is the default, plain is flat shadcn, solid is a neutral tonal face, glass is opt-in and needs a backdrop.
glinr
Crisp on any stage.
Learn moreplain
Crisp on any stage.
Learn moresolid
Crisp on any stage.
Learn moreglass
Opt-in. Needs a backdrop.
Learn moreimport { ShineBorder, Card } from "@glinui/ui"
// Omit `variant` to follow the ambient style (glinr by default).export function ShineBorderVariants() { return ( <> <Card variant="glinr" className="relative"> <ShineBorder borderWidth={2} /> ... </Card> <Card variant="plain" className="relative"> <ShineBorder borderWidth={2} /> ... </Card> <Card variant="solid" className="relative"> <ShineBorder borderWidth={2} /> ... </Card> <Card variant="glass" className="relative"> <ShineBorder borderWidth={2} /> ... </Card> </> )}Colors
`shineColor` takes one color or a list of tokens.
accent
The effect color follows the tone token.
Learn moresuccess
The effect color follows the tone token.
Learn morewarning
The effect color follows the tone token.
Learn moredanger
The effect color follows the tone token.
Learn moreinfo
The effect color follows the tone token.
Learn moreimport { ShineBorder, Card } from "@glinui/ui"
export function ShineBorderTones() { return ( <Card className="relative"> <ShineBorder shineColor={["var(--tone-success)", "var(--color-accent)"]} /> ... </Card> )}In a layout
A pricing row where the highlighted plan wears the shine.
$0/ seat
- Unlimited projects
- Priority support
- Audit log export
$24/ seat
- Unlimited projects
- Priority support
- Audit log export
$60/ seat
- Unlimited projects
- Priority support
- Audit log export
// A pricing row where the highlighted plan wears the shine.import { ShineBorder, Card } from "@glinui/ui"
export function ShineBorderLayout() { return ( <section className="grid gap-4 sm:grid-cols-3"> ... </section> )}Accessibility
- Purely decorative: aria-hidden and pointer-events-none, never receives focus or intercepts clicks.
- Hidden under forced-colors so the parent keeps its real border.
- No information is conveyed by the animation.
ARIA Attributes
- `aria-hidden="true"` on the layer
- `data-animated` reflects whether the sweep is running
Reduced Motion
The sweep only runs when the Glin motion level is full and prefers-reduced-motion is off. Otherwise the border renders as a static gradient frame.
Affected properties
background-position sweepAPI Reference
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
variant | "default" | "plain" | "glass" | No | default | `plain` shines in the foreground color for flat cards, `glass` uses a bright additive shine suited to translucent surfaces. |
borderWidth | number | No | 1 | Border thickness in pixels. |
duration | number | No | 14 | Seconds for one sweep cycle. |
shineColor | string | string[] | No | var(--color-accent) | One color or a list of colors for the gradient stops. |
Source
Import directly from the package or browse the source on GitHub. Click any file to view it.
Import
import { ShineBorder } from "@glinui/ui"Dependencies
@glinui/ui@glinui/motionclass-variance-authorityGenerated API Snapshot
Beta
Generated API Snapshot
BetaAuto-extracted from TypeScript source in packages/ui/src/components/shine-border.tsx. This section is in beta and may lag behind hand-curated docs. Regenerate with pnpm --filter @glinui/docs api:generate.
Generated: 2026-10-08T01:41:21.546Z · Full index: /docs/api-metadata
Primary Props Type
ShineBorderProps
ShineBorderProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
borderWidth | number | No | 1 | Border thickness in pixels. |
duration | number | No | 14 | Seconds for one full sweep cycle. |
shineColor | string | string[] | No | - | One color or a list of colors. Defaults to the accent token. |
variant | "default" | "plain" | "glass" | No | "default" | Variant option from shineBorderVariants. |