border-beam-react
Animated border beam/glow effect component for React applications
What this skill does
# border-beam-react
> Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.
`border-beam` is a lightweight React component that renders an animated traveling glow/beam effect around any element — cards, buttons, inputs, search bars, or any container. It uses CSS `@property` for GPU-accelerated animations with no runtime animation libraries required.
## Installation
```bash
npm install border-beam
```
**Requirements:**
- React 18+
- Modern browser: Chrome 85+, Safari 15.4+, Firefox 128+
## Basic Usage
```tsx
import { BorderBeam } from 'border-beam';
function App() {
return (
<BorderBeam>
<div style={{ padding: 32, borderRadius: 16, background: '#1d1d1d' }}>
Your content here
</div>
</BorderBeam>
);
}
```
`BorderBeam` wraps your content and auto-detects the `border-radius` of the first child element. All effect layers use `pointer-events: none` so they never block interaction.
## Size Presets
```tsx
// Full border glow (default) — for cards, panels
<BorderBeam size="md">
<Card />
</BorderBeam>
// Compact glow — for small elements like icon buttons
<BorderBeam size="sm">
<IconButton />
</BorderBeam>
// Bottom-only traveling glow — ideal for search bars, inputs
<BorderBeam size="line">
<SearchBar />
</BorderBeam>
```
## Color Variants
```tsx
<BorderBeam colorVariant="colorful" /> {/* Rainbow spectrum (default), animates hue */}
<BorderBeam colorVariant="mono" /> {/* Grayscale, no hue animation */}
<BorderBeam colorVariant="ocean" /> {/* Blue-purple tones */}
<BorderBeam colorVariant="sunset" /> {/* Orange-yellow-red tones */}
```
All variants except `mono` animate through a hue-shift cycle by default.
## Theme (Dark / Light / Auto)
```tsx
<BorderBeam theme="dark" /> {/* Default — for dark backgrounds */}
<BorderBeam theme="light" /> {/* For light backgrounds */}
<BorderBeam theme="auto" /> {/* Detects system prefers-color-scheme */}
```
## Controlling Intensity
```tsx
// strength: 0 (invisible) to 1 (full, default) — only affects beam layers
<BorderBeam strength={0.6}>
<Card />
</BorderBeam>
// brightness and saturation multipliers
<BorderBeam brightness={1.5} saturation={1.4}>
<Card />
</BorderBeam>
```
## Play / Pause with Callbacks
```tsx
import { useState } from 'react';
import { BorderBeam } from 'border-beam';
function AnimatedCard() {
const [active, setActive] = useState(true);
return (
<>
<BorderBeam
active={active}
onActivate={() => console.log('Beam faded in')}
onDeactivate={() => console.log('Beam faded out')}
>
<div style={{ padding: 32, borderRadius: 16, background: '#111' }}>
Hover-activated beam
</div>
</BorderBeam>
<button onClick={() => setActive(a => !a)}>Toggle Beam</button>
</>
);
}
```
## Custom Duration and Hue Range
```tsx
<BorderBeam
duration={3.5} // Animation cycle in seconds (default: 1.96 for md, 2.4 for line)
hueRange={60} // Hue rotation range in degrees (default: 30)
staticColors={true} // Disable hue-shift entirely
>
<Card />
</BorderBeam>
```
## Custom Border Radius
If auto-detection doesn't work (e.g., the radius is set via a CSS class), override it:
```tsx
<BorderBeam borderRadius={24}>
<div className="my-card">Content</div>
</BorderBeam>
```
## Forwarded HTML Attributes
The wrapper `<div>` forwards all standard `HTMLDivElement` attributes:
```tsx
<BorderBeam
className="my-wrapper"
style={{ display: 'inline-block' }}
data-testid="beam-card"
>
<Card />
</BorderBeam>
```
## Common Patterns
### Hover-activated beam
```tsx
import { useState } from 'react';
import { BorderBeam } from 'border-beam';
function HoverCard() {
const [hovered, setHovered] = useState(false);
return (
<BorderBeam active={hovered} strength={0.85} colorVariant="ocean">
<div
onMouseEnter={() => setHovered(true)}
onMouseLeave={() => setHovered(false)}
style={{ padding: 24, borderRadius: 12, background: '#0f0f0f' }}
>
Hover me
</div>
</BorderBeam>
);
}
```
### Search bar with line beam
```tsx
import { BorderBeam } from 'border-beam';
function SearchInput() {
return (
<BorderBeam size="line" colorVariant="sunset" theme="dark">
<input
type="text"
placeholder="Search..."
style={{
padding: '12px 16px',
borderRadius: 8,
background: '#1a1a1a',
border: '1px solid #333',
color: '#fff',
width: 320,
}}
/>
</BorderBeam>
);
}
```
### Light theme card
```tsx
import { BorderBeam } from 'border-beam';
function LightCard() {
return (
<BorderBeam theme="light" colorVariant="colorful" strength={0.8}>
<div style={{ padding: 32, borderRadius: 16, background: '#f5f5f5' }}>
Light mode card
</div>
</BorderBeam>
);
}
```
### Reduced motion accessibility
The component itself does not automatically respond to `prefers-reduced-motion`. Handle it in the consumer:
```tsx
import { useReducedMotion } from 'framer-motion'; // or your own hook
import { BorderBeam } from 'border-beam';
function AccessibleCard() {
const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
return (
<BorderBeam active={!reduceMotion}>
<Card />
</BorderBeam>
);
}
```
## Full Props Reference
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `children` | `ReactNode` | — | Content to wrap |
| `size` | `'sm' \| 'md' \| 'line'` | `'md'` | Size/type preset |
| `colorVariant` | `'colorful' \| 'mono' \| 'ocean' \| 'sunset'` | `'colorful'` | Color palette |
| `theme` | `'dark' \| 'light' \| 'auto'` | `'dark'` | Background adaptation |
| `strength` | `number` | `1` | Beam opacity 0–1, does not affect children |
| `duration` | `number` | `1.96` / `2.4` | Animation cycle in seconds |
| `active` | `boolean` | `true` | Play/pause with fade transition |
| `borderRadius` | `number` | auto-detected | Override border radius in px |
| `brightness` | `number` | `1.3` | Glow brightness multiplier |
| `saturation` | `number` | `1.2` | Glow saturation multiplier |
| `hueRange` | `number` | `30` | Hue rotation range in degrees |
| `staticColors` | `boolean` | `false` | Disable hue-shift animation |
| `className` | `string` | — | Class on wrapper div |
| `style` | `CSSProperties` | — | Inline styles on wrapper div |
| `onActivate` | `() => void` | — | Called when fade-in completes |
| `onDeactivate` | `() => void` | — | Called when fade-out completes |
## How It Works
`BorderBeam` renders a wrapper `<div>` with three effect layers — all `pointer-events: none`, absolutely positioned, never affecting layout or interaction:
- **`::after`** — beam stroke (conic gradient masked to the border edge)
- **`::before`** — inner glow layer
- **`[data-beam-bloom]`** — outer bloom/glow child `<div>`
Animations use CSS `@property` for smooth, GPU-accelerated hue cycling.
## Troubleshooting
**Beam not visible:**
- Ensure the child element has a visible `background` and `border-radius`
- Check `strength` is not `0`
- Verify `active` is `true`
**Border radius not matching:**
- Pass `borderRadius` prop explicitly if the radius comes from a CSS class rather than inline style
**Effect covers content / blocks clicks:**
- All layers are `pointer-events: none` by default — if this is happening, check for CSS conflicts in your wrapper
**Animation not working in browser:**
- Requires CSS `@property` support: Chrome 85+, Safari 15.4+, Firefox 128+. Check [caniuse.com/@property](https://caniuse.com/css-at-property)
**SSR / Next.js:**
- The component uses DOM APIs for border-radius detection; wrap in a client component (`'use client'`) in Next.js App Router
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.