Border Beam Panel
motiq/border-beam-panelFreeComponent
A panel with twin comets orbiting a 2px border ring built from a rotating conic gradient cut by a two-layer CSS alpha mask (never an SVG luminance mask). The angular velocity itself is sprung (k=30, d=11), winding to 240 deg/s on hover and coasting back to 42 deg/s, with an optional coral signature comet 180 degrees opposed. One custom property per frame; content never repaints.
Live preview
live · rendered by the registry
Rendered by motiq on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.motiq.dev/r/border-beam-panel.jsonSource
1"use client";23import * as React from "react";45import { cn } from "@/lib/utils";6import { useReducedMotion, useVisibilityPause } from "@/lib/motiq";78/* -------------------------------------------------------------------------- */9/* Types */10/* -------------------------------------------------------------------------- */1112export interface BorderBeamPanelProps extends React.HTMLAttributes<HTMLDivElement> {13 /** Panel content — semantics and layout are entirely yours. */14 children?: React.ReactNode;15 /** One comet, or two opposed comets 180° apart. */16 beams?: 1 | 2;17 /** Comet colors. The second defaults to the rare coral signature. */18 colors?: [string, string?];19 /** Ring thickness in px. */20 thickness?: number;21 /** Resting angular velocity in deg/s (~8.5s per lap at 42). */22 idleSpeed?: number;23 /** Hover/focus angular velocity in deg/s — the springs wind up toward it. */24 hoverSpeed?: number;25 /** Blurred copy of the ring behind the panel, read as cast light. */26 glow?: boolean;27 /** Corner radius in px. */28 radius?: number;29 /** Velocity spring — the SPEED is sprung, so the comets coast instead of snapping. */30 spring?: { stiffness?: number; damping?: number };31 /** Deterministic starting angle (SSR-stable; no Math.random). */32 seed?: number;33 /** Park the loop while scrolled offscreen or the tab is hidden. */34 pauseWhenHidden?: boolean;35 /** Force the static, motion-free lit-border state regardless of system preference. */36 reducedMotion?: boolean;37}3839/* -------------------------------------------------------------------------- */40/* Physics + gradient */41/* -------------------------------------------------------------------------- */4243/** Hand-rolled delta-time spring — keeps the component dependency-free. */44class Spring {45 x: number;46 v = 0;47 target: number;48 k: number;49 d: number;50 constructor(value: number, k: number, d: number) {51 this.x = value;52 this.target = value;53 this.k = k;54 this.d = d;55 }56 step(dt: number): number {57 const a = this.k * (this.target - this.x) - this.d * this.v;58 this.v += a * dt;59 this.x += this.v * dt;60 return this.x;61 }62}6364const clamp = (n: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, n));6566/** Static angle under reduced motion — both comets sit on visible edges. */67const PARKED_ANGLE = 40;6869/**70// … truncated
What it pulls in
Other registry items
Files it writes
More from motiq
All 100 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Activity Streamactivity-stream | motiq | Components | Free | 1 dep | |
| Adaptive Safe-Zone Gridadaptive-safe-zone-grid | motiq | Components | Free | no deps | |
| Agent Run Timelineagent-run-timeline | motiq | Components | Free | 1 dep | |
| AI Response Streamai-response-stream | motiq | Components | Free | 1 dep | |
| Animated Accordionanimated-accordion | motiq | Components | Free | 2 deps | |
| Animated Buttonanimated-button | motiq | Components | Free | 1 dep | |
| Animated Dialoganimated-dialog | motiq | Components | Free | 2 deps | |
| Animated Gridanimated-grid | motiq | Components | Free | 2 deps |
