ValyroUI Русская версия

Animated Border

Light beam running around a border. Pro · Effects › Borders, text and numbers

Wraps any element — a "new" card, a call-to-action, a search field — with light travelling along its border. The light is a conic gradient rotated on the compositor and masked to a ring that sits exactly over the child's own border; the beam's turn is paced by the box's proportions, so it travels the edge at one speed on a wide card too. It pauses off screen and, with reduced motion, rests as a still highlight on one corner.

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add animated-border
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { AnimatedBorder } from 'valyro-ui-pro';

Props

PropTypeDefault
variant'beam' | 'spectrum''beam'beam — a single light travelling around the edge; spectrum — a rotating multi-colour gradient border.
durationnumber6Seconds per lap.
widthnumberBorder width, px.
radiusnumber | stringCorner radius of the wrapped element, so the light follows its shape. Default: the card radius.
glowbooleanfalseSoft light spilling outside the border.
trigger'always' | 'hover' | 'focus''always'When the border lights up: always, while hovered or focused within, or only while focused within (fields).
inlinebooleanfalseLay out inline, for buttons and chips.

Related components

Previous: Particles · Next: Shimmer Text · All Effects