フォーム

Calendar

ポップアップを出さず、月のカレンダーをそのまま置いて日付を選ぶ入力欄。日付はボタンになっていて、選んだ日を色で示します。

ReactVueWeb Components
Storybook で見る

プレイグラウンド

使用例

<Calendar defaultValue={today()} onChange={setDate} locale="ja-JP" />

設定できる項目

名前 既定値 説明
value Temporal.PlainDate | null Selected date (controlled).
defaultValue Temporal.PlainDate | null Initial selection (uncontrolled). @default null
onChange (date: Temporal.PlainDate) => void Called with the newly selected date.
min PlainDateInput Earliest selectable date.
max PlainDateInput Latest selectable date.
isDateDisabled (date: Temporal.PlainDate) => boolean Disable individual dates.
locale Intl.LocalesArgument Locale for month/weekday names.
weekStartsOn Weekday Which weekday the grid starts on. @default 1 (Monday)
aria-label string Calendar Accessible label for the grid. @default 'Calendar'
className string

アクセシビリティ

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

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