Border Beam
Zero-runtime CSS perimeter laser trace with hardware mask clipping and sub-pixel compositing.
Interactive Specification & Studio
Quantum Laser Perimeter
Sub-pixel hardware composite
Quick Start & Consumer Example
Copy-paste ready implementation for React (.tsx). Automatically updates when you modify parameters in the Workbench above.
import React from 'react';
import { BorderBeam } from '@/components/ui/BorderBeam';
export default function BorderBeamDemo() {
return (
<div className="flex min-h-screen items-center justify-center p-8 bg-[#090d16]">
<div className="relative w-full max-w-md overflow-hidden rounded-2xl border border-[#223252] bg-[#131c2e] p-6 shadow-2xl">
<div className="flex items-center justify-between">
<span className="font-mono text-xs font-bold uppercase tracking-wider text-amber-500">
Perimeter Trace // 120 FPS
</span>
<span className="inline-flex size-2 rounded-full bg-emerald-500 animate-pulse" />
</div>
<h3 className="mt-3 text-xl font-bold text-white">Quantum Border Beam</h3>
<p className="mt-2 text-sm leading-relaxed text-slate-400">
Zero-runtime GPU perimeter laser trace with hardware mask clipping and sub-pixel composite.
</p>
<BorderBeam
size={200}
duration={8}
borderWidth={2}
colorFrom="#ffaa40"
colorTo="#9c40ff"
doubleBeam={false}
endOpacity={0}
opacity={1}
/>
</div>
</div>
);
}
Props & Configuration
Exhaustive parameter contract for Border Beam. Validated in the live Studio workbench above and statically checked across all 13 ecosystem templates.
| Prop | Type | Default | Description |
|---|---|---|---|
size | number | 200 | Length/size of the perimeter laser trace. |
duration | number | 8 | Loop duration for one full border sweep. |
borderWidth | number | 2 | Perimeter border stroke width. |
colorFrom | color | #ffaa40 | Starting gradient color. |
colorTo | color | #9c40ff | Ending gradient color. |
doubleBeam | boolean | false | Render a secondary beam located on the opposite side of the perimeter, orbiting in the same direction (180° phase offset). |
endOpacity | number | 0 | Opacity of the beam tail at its trailing edge (0 for pure transparent). |
opacity | number | 1 | Overall opacity of the border beam trace. |
blur | number | 0 | Specular diffuse blur applied to the perimeter laser trace. |
borderRadius | number | 16 | Corner radius of the perimeter path matching card borders. |
Length/size of the perimeter laser trace.
Loop duration for one full border sweep.
Perimeter border stroke width.
Starting gradient color.
Ending gradient color.
Render a secondary beam located on the opposite side of the perimeter, orbiting in the same direction (180° phase offset).
Opacity of the beam tail at its trailing edge (0 for pure transparent).
Overall opacity of the border beam trace.
Specular diffuse blur applied to the perimeter laser trace.
Corner radius of the perimeter path matching card borders.
Component Source
Component source definition for React (.tsx). Toggle between the clean wrapper and the standalone ejected engine micro-kernel.
import * as React from 'react';
import * as BorderBeamPrimitive from '@exhuma/core';
import { clsx } from 'clsx';
export interface BorderBeamProps extends React.ComponentPropsWithoutRef<typeof BorderBeamPrimitive.BorderBeam> {
className?: string;
}
export const BorderBeam = React.forwardRef<HTMLDivElement, BorderBeamProps>(
({ className, children, ...props }, ref) => (
<BorderBeamPrimitive.BorderBeam
ref={ref}
className={clsx(
'pointer-events-none absolute inset-0 rounded-[inherit]',
className
)}
{...props}
>
{children}
</BorderBeamPrimitive.BorderBeam>
)
);
BorderBeam.displayName = 'BorderBeam';
Lifecycle Safety & Performance
Engineered for high-frequency user interactions with zero memory leaks.
Deterministic Cleanup
GPU Compositor Acceleration
will-change: transform without triggering browser layout recalculations.Accessibility Considerations
Fully compliant with WCAG guidelines and respects user motion preferences.
prefers-reduced-motion Support
prefers-reduced-motion: reduce enabled in their operating system, Exhuma components automatically disable 3D gyroscope tilt and spring animations, rendering static accessible content.