仕組み
The card is always dark, because the light needs a night sky: a gradient ink background, a tinted glow in the top corner and a still starfield that fades out towards the bottom. Each meteor is a zero-size anchor turned to 140°; its streak, a pseudo-element with a fading tinted tail and a bright head, travels along that axis during the first 42% of its cycle and rests for the remainder. Positions, lengths, brightness and timing come from a fixed seed, so the server and the browser draw the same sky and only a few streaks cross at once. Everything is CSS, so the motion pauses with the page.
向いている場面
- A single highlighted feature on a landing or pricing page.
- Announcements and launch cards that need atmosphere without imagery.
向かない場面
- Grids of many cards: the motion competes with itself.
- Dense content people must read at length.
使い方
import { MeteorCard } from './MeteorCard.jsx'
export function SyncFeature() {
return (
<MeteorCard
eyebrow="Realtime"
title="Edit together, from anywhere"
description="Cursors, comments and history stay in step across every device."
icon={<SyncIcon />}
count={14}
tint="indigo"
>
<a href="/guide">Read the guide</a>
</MeteorCard>
)
}プロパティ
| プロパティ | 型 | 既定値 | 説明 |
|---|---|---|---|
eyebrow | ReactNode | — | Small uppercase line at the top. |
title | ReactNode | — | Heading (h3). |
description | ReactNode | — | Body text. |
icon | ReactNode | — | Icon in a glassy tile beside the eyebrow. |
children | ReactNode | — | Anything after the text, such as figures or a link. |
count | number | 14 | Number of meteors (0 to 40). |
speed | number | 1 | Pace multiplier; 0.5 is half as fast. |
tint | 'indigo' | 'teal' | 'rose' | 'indigo' | Colour of the glow and the tails. |
stars | boolean | true | Shows the still starfield. |
as | ElementType | 'article' | Root element. |
アクセシビリティ
- The sky is decorative and aria-hidden; the content is ordinary markup with the title as an <h3> inside an <article>.
- Light text on the near-black background stays above 7:1 for the title and 4.5:1 for the body.
- Streaks pass behind the content and fade near it, so they never cross text at full brightness for long.
- Reduced motion removes the meteors entirely; the stars and glow remain.
モーション
Each meteor cycles every 5–11 s (divided by speed); it fades in over 6% of the cycle, crosses about 520px with a gentle ease, fades out by 42% and rests. Hover lifts the content by 1px over 360ms.
プロジェクトに追加
Pro メンバーはプロンプトをコピーし、コーディングエージェントが無料コンポーネントと同じ手順でソースを導入します。
MeteorCard.jsxmeteor-card.csstokens.cssREADME.md
2 つのファイルを一緒に導入します。スタイルは tokens.css の変数を読み、予備の値も持つため、単体でも表示できます。







