Cómo funciona
The card is two shapes on one dark ground: a tab on the right of the top edge and the body under it, its top-right corner square so the tab runs into it. A radial gradient draws the concave corner where the tab's left side curves into the body, and one drop-shadow filter shadows both as a single outline, so the shape stays crisp at any size. The light is an inset panel: three blurred colour fields from the tone drift on long, offset loops (9, 11 and 13 s) and blend as light, and nine ribbon lines run across them with dashes that flow sideways at slightly different speeds. The card stays dark in both themes because the light needs a dark ground. With a link, pointing or focusing lifts the card by 4 px, deepens its shadow and turns the light to full strength.
Úsalo para
- A row of two to four outcome or feature cards on a landing page or a pricing page, each with one number worth remembering.
- A dark section, or a light page that wants a small, bright moment.
Busca otra opción cuando
- Not for dense dashboards: the moving light competes with real data. Use a plain stat card there.
Uso
import { GlowTabCard } from './GlowTabCard.jsx'
export function Outcomes() {
return (
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 18 }}>
<GlowTabCard style={{ width: 200, height: 272 }} index="01" tab="Ship faster" caption="Spec-first UI" value="2.4x" valueLabel="from plan to screen" href="/case-studies/faster" />
<GlowTabCard style={{ width: 200, height: 272 }} index="02" tab="Fewer rewrites" caption="Review rounds" value="-68%" valueLabel="per feature" tone="ember" href="/case-studies/rewrites" />
<GlowTabCard style={{ width: 200, height: 272 }} index="03" tab="Ready to paste" caption="React components" value="210+" valueLabel="in the library" tone="violet" href="/library" />
</div>
)
}Propiedades
| Propiedad | Tipo | Por defecto | Qué hace |
|---|---|---|---|
index | string | — | Short number before the tab label, such as 01, set in the mono face. |
tab | string | — | Label on the tab. It is the card's heading and, with href or onClick, its link. |
caption | string | — | Short line above the figure. |
value | string | — | The large figure, set with tabular digits. |
valueLabel | string | — | Small label beside or under the figure. |
tone | 'accent' | 'ember' | 'violet' | 'mint' | 'accent' | Colours of the flowing light, taken from the palette tokens: accent and secondary, chart reds and ambers, tertiary and violet, or teal and green. |
href | string | — | Makes the tab label a link; a press anywhere on the card follows it. |
onClick | (event) => void | — | Without href, makes the tab label a button; a press anywhere on the card presses it. |
headingLevel | 2 | 3 | 4 | 5 | 6 | 3 | Level of the heading that holds the tab label. |
children | ReactNode | — | Extra content under the figure, such as a short note. |
Accesibilidad
- The card is an article whose heading is the tab label. With href it holds one real link, with onClick one real button; a press anywhere on the card follows it, but the keyboard stops only once.
- Focusing the link draws an outline round the whole card and lifts it, the same as pointing at it.
- The light is decorative and aria-hidden. Text is near-white on a near-black ground in both themes; the caption and labels keep a contrast above 4.5:1.
- Under reduced motion the colour fields and ribbon lines hold still and the card does not lift.
Movimiento
Colour fields drift on 9, 11 and 13 s loops that run back and forth; the ribbon dashes flow over 7 to 12 s. The lift takes 360 ms on the ease-out curve. Under reduced motion nothing moves.
Añádelo a tu proyecto
Los miembros Pro copian un prompt y su agente de programación instala el código, igual que con los gratuitos.
GlowTabCard.jsxglow-tab-card.csstokens.cssREADME.md
Los dos archivos se instalan juntos. La hoja de estilos lee las variables de tokens.css y lleva valores de reserva, así que también funciona sola.







