Border Beam Demo
A login card example with an animated BorderBeam effect around its perimeter. It combines shadcn/ui card, form, input, label, and button components with Magic UI’s decorative border animation.
exampleregistry-item.json


Installed with plain
See how it was built shadcn add · no workarounds · theme neutral (none shipped)Installation
pnpm dlx shadcn@latest add @magicui/border-beam-demo
Requires @magicui in the registries of your components.json (shadcn adds official directory namespaces automatically).
Usage
usage.tsx
import { BorderBeam } from "@/registry/magicui/border-beam"export function BorderBeamExample() { return ( <div className="relative w-[350px] overflow-hidden rounded-xl border p-6"> <h2 className="text-lg font-semibold">Featured panel</h2> <p className="text-muted-foreground text-sm">Content highlighted by a moving border beam.</p> <BorderBeam duration={8} size={100} /> </div> )}- Use as a visual example of BorderBeam integrated with a shadcn/ui Card.
- Use for login, registration, authentication, or other compact form panels that need visual emphasis.
- Use when a subtle animated border can draw attention to a featured card or call to action.
- Use as a starting point for experimenting with BorderBeam duration and size values.
Examples
Authentication card
A login card matching the registry demo’s form-oriented use case.
authentication-card.tsx
import { BorderBeam } from "@/registry/magicui/border-beam"export function AuthenticationCard() { return ( <div className="relative w-[350px] overflow-hidden rounded-xl border p-6"> <h2 className="text-lg font-semibold">Sign in</h2> <p className="text-muted-foreground mt-1 text-sm">Access your account.</p> <button className="mt-6 rounded-md bg-primary px-4 py-2 text-primary-foreground"> Continue </button> <BorderBeam duration={8} size={100} /> </div> )}Featured announcement
A highlighted announcement panel using a slower, larger beam.
featured-announcement.tsx
import { BorderBeam } from "@/registry/magicui/border-beam"export function FeaturedAnnouncement() { return ( <div className="relative max-w-md overflow-hidden rounded-xl border p-6"> <p className="text-sm font-medium">New feature</p> <h2 className="mt-2 text-2xl font-semibold">Automate your workflow</h2> <p className="text-muted-foreground mt-2 text-sm"> Explore the latest tools in your workspace. </p> <BorderBeam duration={10} size={150} /> </div> )}API reference
PropTypeDefaultDescription
Component propsnull—The registry item exports a zero-props default Component. Its internal BorderBeam instance is configured with duration={8} and size={100}; the demo does not expose those values as component props.
Accessibility
- The demo uses visible labels associated with each input through matching htmlFor and id values.
- The email and password fields use appropriate input types, enabling browser validation and relevant platform input behavior.
- The animated beam is decorative and should not be the only way to communicate focus, status, or importance.
- For motion-sensitive users, consider applying a reduced-motion strategy around the animated effect or providing a non-animated variant.
- The Register and Login buttons are native button elements through the shadcn/ui Button component and remain keyboard accessible.
Docs written by openai:gpt-5.6-luna from the registry source.
Use with Coding Agent
Paste this into Claude Code, Codex or Cursor. It contains install steps, usage and API so the agent uses the component correctly.
prompt.md
Use the "Border Beam Demo" component (magicui/border-beam-demo) from its shadcn registry.1. Install it with: npx shadcn@latest add @magicui/border-beam-demo2. Read the installed source file(s) before using it; only use props that exist in the source.3. Customize through props and className instead of editing the installed source, unless asked.4. Available props: Component props.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { BorderBeam } from "@/registry/magicui/border-beam"export function BorderBeamExample() { return ( <div className="relative w-[350px] overflow-hidden rounded-xl border p-6"> <h2 className="text-lg font-semibold">Featured panel</h2> <p className="text-muted-foreground text-sm">Content highlighted by a moving border beam.</p> <BorderBeam duration={8} size={100} /> </div> )}```Files & dependencies
- registry/example/border-beam-demo.tsx
registryDependencies@magicui/border-beam