Skip to content
synccn

Border Beam

A light that travels around a card's border.

Pro plan

$12 per month

Every component, block and theme, plus updates as they ship.

Installation

$ pnpm dlx shadcn@latest add @synccn/border-beam

First time in this project? Connect synccn with one command.

Usage

import { BorderBeam } from "@/components/ui/border-beam";<div className="relative overflow-hidden rounded-xl">  …  <BorderBeam /></div>

API reference

Generated from the component's TypeScript types, so it always matches the code.

BorderBeam

A short light that travels around its parent's border. Place inside a `relative overflow-hidden rounded-*` element.

  • size
    number

    Default 120

    Length of the light in pixels.

  • duration
    number

    Default 6

    Seconds per lap.

  • delay
    number

    Default 0

    Seconds to offset the start.

  • colorFrom
    string

    Default "var(--primary)"

    Colour at the head of the light.

  • colorTo
    string

    Default "transparent"

    Colour at the tail.

  • borderWidth
    number

    Default 1.5

    Border thickness in pixels.

  • className
    string

    Extra classes for the root element.

Dependencies

Read from the component's imports when the site builds. The CLI installs all of these for you.

Helpers

npm packages

Accessibility

From the source

Read from this component's code when the site builds, so it can't drift.

No ARIA roles, key handling or motion settings in its source. It renders plain elements, so its accessibility comes from the content and labels you give it.