Basic Floating Action Button
A round, fixed icon button for the one action a screen is really about - with a ring that survives any backdrop.
6 個のフレームワーク初級
A compact 44px FAB - trimmed to the minimum comfortable touch target and no smaller.
<!--
A mini FAB is 44px, not smaller - that is the minimum comfortable touch target,
so "mini" trims the standard 56px to the floor and stops. The aria-label is
still the whole accessible name; the smaller glyph does not change that.
-->
<button type="button" aria-label="Add item" class="fixed bottom-6 right-6 z-40 inline-flex h-11 w-11 items-center justify-center rounded-full bg-blue-600 text-white shadow-[0_8px_20px_-6px_rgba(15,23,42,0.4)] transition hover:bg-blue-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 focus-visible:ring-offset-white motion-safe:hover:-translate-y-px disabled:pointer-events-none disabled:opacity-50 dark:bg-blue-500 dark:hover:bg-blue-400 dark:focus-visible:ring-blue-400 dark:focus-visible:ring-offset-gray-950">
<svg class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true" focusable="false"><path d="M12 5v14M5 12h14" /></svg>
</button>| Prop | 型 | デフォルト | 説明 |
|---|---|---|---|
ariaLabel必須 | string | - | ボタンのアクセシブルな名前。アイコンのみのボタンでは必須です。 |
icon | ReactNode | - | コンテンツと並べて表示されるアイコン要素。 |
onClick | () => void | - | ユーザーがコントロールを実行したときに発火します。 |
disabled | boolean | false | 操作を無効にし、コントロールを淡色表示にします。 |
A mini FAB is 44px, not smaller: that is the floor for a comfortable touch target, so "mini" trims the standard 56px to the minimum and stops. The `aria-label` remains the whole accessible name; the smaller glyph does not change that.