アクション

Toolbar

ボタンや操作をひとまとめにするツールバー。role="toolbar" を持ち、Tab では1か所に止まり、矢印キーで項目間を移動します。横と縦の向きに対応します。

ReactVueWeb Components
Storybook で見る

プレイグラウンド

使用例

<Toolbar aria-label="Text formatting">
  <Button variant="ghost" size="sm">Bold</Button>
  <Button variant="ghost" size="sm">Italic</Button>
  <Button variant="ghost" size="sm">Underline</Button>
</Toolbar>

設定できる項目

名前 既定値 説明
orientation 'horizontal' | 'vertical' horizontal Layout direction; maps to `aria-orientation`. @default 'horizontal'
aria-label 必須 string Accessible label for the toolbar (`aria-label`).
children 必須 ReactNode Toolbar items: buttons, toggles, or other controls.
className string

アクセシビリティ

  • 文字と背景の明るさの差をしっかり取り、読みやすくしています。ライトでもダークでも、見やすさの国際基準 WCAG の最高ランク AAA(明るさの差が 7:1 以上)を満たします。
  • マウスがなくても、キーボードだけですべての操作ができます。
  • いまどこを操作しているかを示す枠(フォーカスの囲み)が、常にはっきり見えます。
  • 利用者が「画面の動きを減らす」設定にしているときは、過剰なアニメーションを止めます。

どのコンポーネントも、だれにとっても使いやすいように、見やすさの国際基準 WCAG の最高ランク AAA(WCAG 2.1 AAA)を満たすよう作っています。