仕組み
The light is one conic gradient with a white centre, painted on a square layer 150% as wide as the pill and centred on it. When the pointer arrives, the component measures the button once and turns that layer with transform: rotate() to the pointer's angle from the centre, starting 150° behind so the band sweeps round the edge to meet it; while the pointer moves the angle is updated and unwrapped, so it always turns the short way. The same layer appears three times: masked to a 2px ring (the rim), blurred behind the pill (a wide bloom and a tight halo) and blurred inside it, masked to the inner edge with screen blending (light seeping into the glass), plus a soft specular spot under the pointer. Every move is a transform, so it runs on the compositor and nothing is repainted per frame. Unlike the border beam, which sends a beam round a card on its own clock, this button is dark until it is approached, and its light answers where the pointer is.
向いている場面
- The single most important action on a landing page or an empty state: start, create, try.
- A premium moment in a product: upgrade, publish, generate.
- Dark hero sections, where the bloom reads best.
向かない場面
- Rows of ordinary buttons, forms and toolbars: use the base button.
- More than one per view; the effect only works when it is rare.
- Destructive actions: the colour suggests delight, not caution.
使い方
import { AuroraRimButton } from './AuroraRimButton.jsx'
const Plus = (
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round">
<path d="M10 4.5v11M4.5 10h11" />
</svg>
)
export function HeroActions({ onStart }) {
return (
<AuroraRimButton icon={Plus} lit onClick={onStart}>
Start a list
</AuroraRimButton>
)
}プロパティ
| プロパティ | 型 | 既定値 | 説明 |
|---|---|---|---|
children | ReactNode | — | The button text. |
icon | ReactNode | — | An 18px icon before the text, usually an inline SVG that uses currentColor. |
tone | 'ink' | 'accent' | 'ink' | The pill's fill. Ink is near-black in both themes (a dark glass in the dark theme); accent uses the accent role. |
size | 'sm' | 'md' | 'lg' | 'md' | Height 36, 44 or 52px. |
lit | boolean | false | Keeps a quieter rim and glow on at rest, drifting slowly, for the one call to action on a page. |
glow | boolean | true | The blurred bloom outside the rim. |
colors | string[] | — | Up to five colours for the band, from one end to the other; the third is the bright centre that faces the pointer. Defaults to the tertiary, chart 4, white, secondary and accent. |
...rest | ButtonHTMLAttributes | — | Other attributes go to the <button>, including onClick, disabled and type (button by default). |
アクセシビリティ
- It is a native <button>: Tab, Enter and Space work and disabled is respected.
- Keyboard focus shows the focus ring and sends the band slowly round the rim, so focus looks as alive as hover.
- The text sits on the solid fill, not on the light, so its contrast does not change while the rim glows.
- On touch, a press lights the rim toward the finger and keeps it for 0.7s after lifting.
- Reduced motion still lights the rim and glow, at a fixed angle, without sweeping, swaying or following the pointer.
モーション
Follow: transform 760ms cubic-bezier(0.16, 1, 0.3, 1), entering 150° behind the pointer. Sway while awake: ±14° over 3.4s. Light on: 360ms; off: 620ms. Lit at rest: −34° to 46° over 7s. Keyboard focus: one turn every 5.6s. Press: scale 0.98 in 100ms.
プロジェクトに追加
Pro メンバーはプロンプトをコピーし、コーディングエージェントが無料コンポーネントと同じ手順でソースを導入します。
AuroraRimButton.jsxaurora-rim-button.csstokens.cssREADME.md
2 つのファイルを一緒に導入します。スタイルは tokens.css の変数を読み、予備の値も持つため、単体でも表示できます。



