Beam border
A call-to-action panel with a gradient hairline border.
Preview
A beam of light travels around the border, with a soft glow outside the panel that follows it. It has a pause button and stops while off screen. With reduced motion turned on, it renders the plain layout.
Sample offer
Ship the landing page this weekend
Copy the sections, keep the code, change anything. Sample copy.
Sample offer
Ship the landing page this weekend
Copy the sections, keep the code, change anything. Sample copy.
Installation
Run this in a project that already uses shadcn/ui. It adds the component and anything it needs; the motion version also adds the plain one and the motion package.
Usage
import { BeamBorder } from "@/components/custom/beam-border/beam-border";
<BeamBorder
title="Ship the landing page this weekend"
description="Copy the sections, keep the code."
primaryAction={{ label: "Get started", href: "/signup" }}
/>import { BeamBorderMotion } from "@/components/custom/beam-border/beam-border-motion";
<BeamBorderMotion
title="Ship the landing page this weekend"
primaryAction={{ label: "Get started", href: "/signup" }}
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title* (required) | string | – | The heading, rendered as an h2. |
| eyebrow | string | – | Small badge above the title. |
| description | string | – | Supporting line under the title. |
| primaryAction | { label: string; href: string } | – | Filled button. |
| secondaryAction | { label: string; href: string } | – | Outline button. |
| ...props | React.ComponentProps<"section"> | – | Any other section attribute (id, aria-*, data-*, ref) goes to the root element. |
| Prop | Type | Default | Description |
|---|---|---|---|
| title* (required) | string | – | The heading, rendered as an h2. |
| eyebrow | string | – | Small badge above the title. |
| description | string | – | Supporting line under the title. |
| primaryAction | { label: string; href: string } | – | Filled button. |
| secondaryAction | { label: string; href: string } | – | Outline button. |
| ...props | React.ComponentProps<"section"> | – | Any other section attribute (id, aria-*, data-*, ref) goes to the root element. |
Accessibility
- The beam loops, so the motion version shows a Pause border button (WCAG 2.2.2). It also stops while off screen.
- With reduced motion the static gradient border is shown and there is no button.
- The motion version follows the visitor's reduced-motion setting and never hides content before it animates.