Gradient Glow Button
A call-to-action button with a gradient fill and a soft coloured glow on hover.
6 個のフレームワーク初級
A fully rounded button with a leading count badge for unread or pending totals.
<!--
The count is a real text node inside the button, not an aria-hidden
decoration, so the accessible name reads "12 Notifications" - which is the
information a badge is there to convey in the first place.
-->
<button class="pill-btn" type="button">
<span class="pill-btn__count">12</span>
Notifications
</button>| Prop | 型 | デフォルト | 説明 |
|---|---|---|---|
count必須 | number | - | バッジに表示される数値。99 を超えると「99+」と表示されます。 |
children必須 | ReactNode | - | コンポーネントの内部にレンダリングされるコンテンツ。 |
disabled | boolean | false | 操作を無効にし、コントロールを淡色表示にします。 |
onClick | () => void | - | ユーザーがコントロールを実行したときに発火します。 |
The `rounded-full` radius is deliberately larger than any height the button can reach, which is what keeps the ends true semicircles at every size instead of a radius you have to re-guess. The count is a real text node, not an `aria-hidden` decoration, so the accessible name reads "12 Notifications" - which is the whole reason a badge is there. `tabular-nums` stops the width jittering as the number ticks.