Border Beam

A component for creating animated border beam effects around elements with customizable gradients, duration, and direction.

motion-sv
Login

Enter your credentials to access your account.

Installation

pnpm dlx shadcn-svelte@latest add https://sv-animations.vercel.app/r/border-beam.json

Usage

<script lang="ts">	import { BorderBeam } from "#lib/components/magic/border-beam/index.js";</script>
<div class="relative overflow-hidden rounded-xl border p-8">	Border beam	<BorderBeam /></div>

Examples

2 Border Beams

Now Playing

Stairway to Heaven - Led Zeppelin

2:45 8:02

Reverse

Login

Enter your credentials to access your account.

Spring

Props

Border Beam

A component for creating animated border beam effects.

NameTypeDefaultDescription
sizenumber50The size of the border beam in pixels
durationnumber6The duration of the animation in seconds
delaynumber0The delay before the animation starts in seconds
colorFromstring"#ffaa40"The starting color of the gradient
colorTostring"#9c40ff"The ending color of the gradient
transitionTransitionundefinedCustom motion transition configuration
classClassValueundefinedAdditional CSS classes to apply
stylestringundefinedAdditional inline styles
reversebooleanfalseWhether to reverse the animation direction
initialOffsetnumber0The initial offset position (0-100)
borderWidthnumber1The border width of the beam in pixels