Skip to content

Border Beam

Free

Light on the edge of a card, field, or button while work runs: a lap, a line, a pulse, a color flow, a voice level, or a rim. No light at rest.

  • Base UI
  • Motion
  • React 19
  • Tailwind CSS 4

Added Nov 9, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Wrap one child. Set active while the work runs, then set outcome.

summary-card.tsx

BorderBeam

<div>
PropTypeDefaultDescription
childrenReactNode—
type"beam""flow""level""line""pulse""rim""beam"The look of the light. beam (default): a band laps the edge. line: light on one side that breathes. pulse: the whole edge breathes. flow: the whole edge lit, colors drift apart. level: the whole edge follows level. rim: the full edge, a breath, and a pointer spot.
colorsreadonly string[]DEFAULT_COLORSOne to seven CSS colors of the light, in order along the light. Default: the primary token. AURORA_COLORS (the aurora colors, also for flow) lives in #/lib/aurora-colors.
activebooleanfalseThe work runs: the light comes in, and goes out when it turns false. Default false.
outcome"done""error"—The result of the work. A change to done draws a success rim that closes its loop; a change to error shows a destructive rim. In 150ms, a hold of 600ms, out in 600ms. A value set at mount shows no rim. Set it back to undefined when the next run starts.
levelMotionValue<number>—The audio level, 0 to 1, of the level type, or of a flow that swells with a voice (a Motion value, so React does not render per frame). The edge smooths it (smoothLevel), so it swells and never flickers. Without it the edge is fully lit.
durationnumber—Seconds of one cycle. Default per type: beam 4.5, line 2.4, pulse 2.4, flow 7, rim 4.
lengthnumber0.25The share of the edge that the beam lights, 0.04 to 0.5. Default 0.25.
count121How many beams lap the edge, on one clock. Default 1.
palette"carried""painted""carried"carried (default): every color rides inside the beam. painted: the colors stay in place around the edge, and the beam shows the color under it, so it changes hue as it travels.
side"bottom""top""bottom"The side that the line lights. Default bottom.
origin"bottom""pointer""side""bottom"Where the flow light opens: bottom (default), side (the inline end), or pointer.
placement"inside""outside""inside"Where the flow light falls. inside (default): it spills inward, for panels and page edges. outside: a halo, and the surface stays clean, for cards and dialogs.
strengthnumber1The strength of the light layers, 0 to 1 (never the outcome rim). Default 1.
bloombooleantrueThe soft bloom around the child. Default true.
innerLightbooleantrueThe light that falls on the surface inside the edge (beam, line, inside flow). Default true.
radiusstring | number—The corner radius of the light, in px or any CSS length. Default: the radius of the child, read when its size changes.
onSettle—Called when the light comes to rest: running after it came in, off after it went out.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.
  • Wrap one child and set active while the work runs. The light goes out when it turns false.
  • Set outcome to done or error when the work ends, and back to undefined when the next run starts.
  • Use type="level" with a Motion value in level for a voice input, and type="flow" for a whole panel.
  • Use placement="outside" on a flow card or dialog, so the surface stays clean.
  • For work with a known percent, use a Progress.
  • For a part of the page that loads, use a Skeleton.
  • For a small wait inside a button, use a Spinner.

Every light layer is aria-hidden and ignores the pointer. The child keeps its own role, focus, and clicks.

The light adds no text. Put the state of the work in the child, so every reader gets it.

The outcome rim fades in over 150ms, so a quick change of outcome never flashes more than three times a second.

Light in and out
theme · 450ms · ease-panel (0.2, 0.4, 0.2, 1)
Beam lap
progress · one lap in `duration` seconds (4.5 by default), at one speed
Line and pulse breath
sine · one breath in `duration` seconds (2.4 by default)
Flow opens
chart · 600ms · the light opens from its origin around both sides
Outcome rim
fade · 150ms in, a 600ms hold, then 600ms out (chart)
  1. AddedBorder Beam.
Open the release