フィードバック

Alert

状況を伝えるメッセージ。成功・警告・エラーなどを色とアイコンで示します。

ReactVueWeb Components
Storybook で見る

プレイグラウンド

使用例

<Alert status="success" title="Saved">Your changes are stored.</Alert>
<Alert status="danger" role="alert" onClose={dismiss}>Something failed.</Alert>

設定できる項目

名前 既定値 説明
status AlertStatus primary Semantic color/intent. @default 'primary'
title ReactNode Optional bold title shown above the body.
icon ReactNode Optional leading icon.
onClose () => void Show a dismiss button; called when clicked.
closeLabel string Close Accessible label for the dismiss button. @default 'Close'
role 'alert' | 'status' status ARIA live semantics. Use `'alert'` (assertive) for errors that need immediate attention, `'status'` (polite) for non-critical messages.

アクセシビリティ

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

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