Langsung ke konten
Skillpedia
Website & UI (frontend)7.2k · #13400

beam-glow-states

Fungsinya

Skill ini memandu agent AI memakai paket border-beam untuk menambahkan cahaya yang bergerak atau bernapas pada bagian aplikasi React. Cocok untuk pengembang yang menginginkan tanda status yang jelas tanpa visual yang berat.

Kapan dipakai

  • ✓Saat tombol atau kartu perlu menunjukkan bahwa sedang memuat, terpilih, atau diproses.
  • ✓Saat input, tab, atau opsi memerlukan pendar fokus atau status saat ini yang jelas.
  • ✓Saat panel tugas agent AI memerlukan sorotan beranimasi yang terkendali.

Link skill

https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/beam-glow-states/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/beam-glow-states/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit →

Contoh permintaan ke AI

“Tambahkan pendar beranimasi yang lembut di sekitar kartu yang sedang diproses di dasbor React saya.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent memasang paket dan membungkus elemen dengan komponen beam, dengan memilih ukuran dan status. Status tetap harus terbaca dari teks dan bentuk, karena animasinya bisa dimatikan.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Beam Glow States

Use the beam as a decorative state accent. Keep the state understandable through text, shape, contrast, and the correct semantic attribute when the animation is absent.

The API below was verified against border-beam 1.3.0. Recheck the official README and exported types when the installed version changes.

Install and import

Install the same package with the repository's package manager:

npm install border-beam
pnpm add border-beam
yarn add border-beam
bun add border-beam

The package requires React and React DOM 18 or newer. It ships ESM, CommonJS, and TypeScript declarations. It injects component-scoped styles, so do not import a separate CSS file.

Prefer the named import:

import { BorderBeam } from "border-beam";
import type {
  BorderBeamProps,
  BorderBeamSize,
  BorderBeamTheme,
  BorderBeamColorVariant,
} from "border-beam";

The default component export is also supported:

import BorderBeam from "border-beam";

In a Next.js App Router project, render it from a client component because it uses React state, effects, observers, and animation frames:

"use client";

import { BorderBeam } from "border-beam";

Choose the effect

size Motion Best use
sm Compact traveling border Icon buttons, pills, compact controls
md Full traveling border Selected cards, current panels, primary active surfaces
line Traveling bottom edge Search, prompt, input, progress, or command surfaces
pulse-inner Contained breathing glow Loading cards, processing panels, persistent selected states
pulse-outside Outward breathing halo One prominent active task or hero control with room to bloom

Use these defaults by state:

  • Loading or processing: pulse-inner, strength={0.55} to 0.75, duration={2.3} to 3.
  • Selected or current: md or pulse-inner, strength={0.3} to 0.55, duration={3.2} to 5.
  • Focus or short active feedback: sm or line, strength={0.35} to 0.6.
  • High-priority live task: pulse-outside, strength={0.45} to 0.7; allow only one in a view.

Start with colorVariant="mono" for neutral product UI, ocean for cool technical states, sunset for warm urgency, and colorful for a rare high-salience moment.

Start with one mounted wrapper

Keep BorderBeam mounted and toggle active. Removing it when state becomes false skips the built-in fade-out.

<BorderBeam
  size="pulse-inner"
  colorVariant="ocean"
  theme="dark"
  strength={0.65}
  active={isWorking}
>
  <section className="task-card" aria-busy={isWorking}>
    <p>{isWorking ? "Generating layout options…" : "Layout options ready"}</p>
  </section>
</BorderBeam>

active fades in over 0.6s and fades out over 0.5s. Use onActivate and onDeactivate only when work must align with the completed visual transition.

Wire loading state

Make the loading state truthful before adding the beam:

<BorderBeam
  size="pulse-inner"
  colorVariant="ocean"
  strength={0.65}
  active={pending && !reduceMotion}
  onDeactivate={() => {
    // Optional: advance only after the 0.5s beam exit completes.
  }}
>
  <section className="beam-surface" aria-busy={pending}>
    <span className="status-dot" aria-hidden="true" />
    <span>{pending ? "Building preview…" : "Preview ready"}</span>
  </section>
</BorderBeam>
  • Show a visible status label or progress value; never make the moving edge the only loading cue.
  • Avoid showing the beam for operations that finish in roughly 150ms or less.
  • Once shown, keep the loading presentation visible for about 400ms to 600ms to prevent a flash.
  • Preserve layout between pending and complete states.
  • Keep cancellation, retry, and error controls usable. The effect layers already use pointer-events: none.

Use line when the work belongs to one input or prompt bar. Use pulse-inner when the whole card is busy.

Wire selected or current state

Use the component state and the semantic state together:

<BorderBeam
  size="md"
  colorVariant="mono"
  staticColors
  duration={4.2}
  strength={0.42}
  active={selected && !reduceMotion}
  className="beam-card"
>
  <button
    type="button"
    className="beam-surface"
    aria-pressed={selected}
    onClick={onSelect}
  >
    {label}
  </button>
</BorderBeam>
  • Use aria-selected for tabs, listbox options, grid cells, and similar selection widgets.
  • Use aria-current for
Pertanyaan umum

Apakah saya perlu mengimpor stylesheet terpisah?

Tidak. Paket ini menyuntikkan gayanya sendiri, sehingga cukup mengimpor komponennya.

Apakah bisa dipakai di luar React?

Skill ini ditulis untuk proyek React dan Next.js.

Bagaimana jika pengunjung lebih suka gerakan yang sedikit?

Skill ini menyertakan panduan gerakan yang dikurangi dan aksesibilitas, sehingga status tetap bisa dipahami tanpa animasi.

Detail

Deskripsi asli dari pembuat

Create React loading, processing, selected, current, focus, and pressed states with the border-beam package's animated edge glow. Use when a card, button, input, tab, option, task panel, or agent surface needs a restrained traveling or breathing beam; includes installation, imports, prop selection, state wiring, reduced motion, accessibility, and performance and layout guardrails.

repo: MengTo/Skills

Popularitas

Bintang GitHub
7.2k
Peringkat
#13400
Lisensi
MIT
Diperbarui
1/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa