BorderBeam

A light that runs around the edge of whatever it wraps, at an even pace along straight sides and rounded corners alike. Reduced motion parks it still. Effects.

Open playground
Priority supportReplies inside the hour, every day of the week.

About

BorderBeam is a React component in the Effects category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { BorderBeam } from "@ashutoshswamy/smoui" and set radius, duration, thickness among its 5 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { BorderBeam } from "@ashutoshswamy/smoui";

<BorderBeam radius={24} duration={5}>
  <Card />
</BorderBeam>

Props 5

radius

Corner radius in px. Match your content.

numberdefault 24
duration

Seconds per lap.

numberdefault 5
thickness

Line width in px.

numberdefault 2
length

Beam length in px.

numberdefault 90
color

Defaults to the accent.

string