beam-glow-states

Implements animated border-beam glow states for React loading, selected, and focus UI.

5.7k|685|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/MengTo/Skills --skill beam-glow-states
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: beam-glow-states
Source: https://github.com/MengTo/Skills/tree/main/agent-skills/web-design/beam-glow-states
Command: npx skills add https://github.com/MengTo/Skills --skill beam-glow-states

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires border-beam.

What problem does it solve?

React interfaces often lack clear, restrained visual feedback for loading, selected, current, focus, and pressed states, leaving users unsure whether an action is processing or an item is active.

Core Features & Use Cases

  • State-driven beam effects: Wire the border-beam package's traveling and breathing glow presets (sm, md, line, pulse-inner, pulse-outside) to loading, selected, focus, and active states with recommended strength and duration values.
  • Accessibility and reduced motion: Pair every beam with correct ARIA semantics (aria-busy, aria-selected, aria-current, aria-pressed) and disable animation under prefers-reduced-motion with static fallbacks.
  • Layout and performance guardrails: Handle wrapper sizing, border-radius detection, overflow clipping, pulse-outside halo spacing, and one-dominant-beam-per-viewport restraint.
  • Use Case: A task card in a Next.js app shows a breathing ocean glow with aria-busy while generating layout options, then fades out and switches to a quiet static selected style when complete.

Quick Start

Use the beam-glow-states skill to add a restrained loading and selected beam glow to this React card component.

Frequently Asked Questions about beam-glow-states

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add an animated border glow to a React component?

Install the border-beam package and wrap your element with the BorderBeam component, choosing a size preset like md or pulse-inner. Toggle the active prop based on component state rather than unmounting, so the built-in fade-in and fade-out transitions run.

How to show a loading state with border-beam in React?

Use the pulse-inner preset with strength around 0.55 to 0.75 and duration of 2.3 to 3 seconds, bound to your pending flag. Always pair it with a visible status label and aria-busy, and keep the loading state visible for at least 400 to 600 milliseconds to avoid flashing.

Does border-beam work with Next.js App Router?

Yes, but BorderBeam must render inside a client component because it uses React state, effects, observers, and animation frames. Add the "use client" directive at the top of the file that imports it. It requires React and React DOM 18 or newer.

How do I handle prefers-reduced-motion with animated border effects?

Pulse presets stop animating automatically under prefers-reduced-motion, but rotate and line presets must be disabled by the consumer using a matchMedia hook. Provide static fallbacks such as border color changes and focus outlines so state remains visible without motion.

Why does the border beam appear around empty space instead of my element?

The beam follows the wrapper bounds, so the first child must align to the wrapper's edges. Set the wrapper to inline-block for compact controls or width 100% for cards, and pass borderRadius explicitly when corner radius detection is unreliable.

When should I not use an animated beam glow for UI states?

Avoid beams for operations finishing in roughly 150 milliseconds or less, and never run multiple simultaneous beams in one viewport since they flatten hierarchy and increase paint work. Do not rely on the beam as the only state cue; keep text, contrast, and semantic attributes.