Skip to content

Time Input

The Time Input component is a form control that allows users to enter or select a time of day using segmented text fields, supporting keyboard entry and optional granularity.

  • Collect a specific time value in forms (e.g., appointment scheduling, event start/end, alarm settings).
  • When precise time entry is required and locale-aware formatting is beneficial.
  • Pair with Date Input for combined date-time selection if needed.
  • Segmented input field: Separate editable segments for hour, minute, second, and period (AM/PM).
  • Select field: Use the Select components when free-form typing may lead to errors or when offering constrained choices is preferred.
  • With label and description: Clear labeling above and optional helper text below.
  • Inline with other form fields: In forms alongside text inputs or date fields.
  • Validation feedback: Show error state for invalid or required times.
  • For durations or time ranges; use separate controls.
  • For relative times (e.g., “in 2 hours”); use text or a specific time.
VariantUse Case
HourCoarse granularity (hours only)
Minute (default)Standard with hours and minutes
SecondFine granularity including seconds
ElementDescription
LabelText describing the purpose of the input.
FieldSegmented text fields for time components (hour, minute, second, period).
PlaceholderOptional placeholder value shown when empty.
DescriptionOptional helper text below the field.
Error MessageValidation error text displayed in error state.
StateDescriptionVisual Indicators
DefaultDefault interactive stateNeutral border and text
HoverCursor over objectSubtle border or background change
FocusKeyboard focus (visible on Tab or arrow key navigation) or on clickHigh-contrast focus ring
DisabledNon-interactiveGrayed out
InvalidValidation errorRed border, error icon/message
  • Use clear, concise labels (e.g., “Start time”, “Meeting time”).
  • Respect locale for format (12-hour with AM/PM or 24-hour).
  • Placeholder: Use locale-appropriate example (e.g., ”—:— —” or “hh:mm”).
  • Error messages: Specific and actionable (e.g., “Please enter a valid time”).
  • Use role="group" with aria-labelledby for the label.
  • Each segment should be focusable with appropriate aria-label (e.g., “hours”, “minutes”).
  • Announce value changes and validation errors via associated description or live region.
  • Support aria-required, aria-invalid, and aria-errormessage.
  • Ensure visible focus indicators and sufficient contrast.

Support standard keyboard navigation

  • Tab: Focus the first segment; subsequent Tab moves to next field.
  • Arrow Left/Right: Move between segments.
  • Arrow Up/Down: Increment/decrement value in focused segment.
  • Typing digits: Direct entry into segment.
  • Enter: Commit value if applicable.
  • Escape: Revert to previous value if editing.