フォーム

Time Picker

時と分を選んで時刻を入れる入力欄。必要なら午前・午後の切り替えも加えられます。

ReactVueWeb Components
Storybook で見る

プレイグラウンド

使用例

<TimePicker defaultValue={Temporal.PlainTime.from('09:30')} minuteStep={15} onChange={setTime} />
<TimePicker hour12 defaultValue={Temporal.PlainTime.from('13:00')} />

設定できる項目

名前 既定値 説明
value Temporal.PlainTime | null Controlled time (a `Temporal.PlainTime`), or `null`.
defaultValue Temporal.PlainTime | null Initial time when uncontrolled. @default null
onChange (value: Temporal.PlainTime | null) => void Called with the new `Temporal.PlainTime` (or `null`).
minuteStep number 5 Minute increment. @default 5
hour12 boolean false Use 12-hour display with an AM/PM select. @default false
disabled boolean false Disable the control. @default false
hourLabel string Hour Accessible label for the hour select. @default 'Hour'
minuteLabel string Minute Accessible label for the minute select. @default 'Minute'
meridiemLabel string AM/PM Accessible label for the AM/PM select. @default 'AM/PM'
id string
className string

アクセシビリティ

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

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