Date Input
Lab componentDate Input
DateInputSingle
and DateInputRange
provides an editable field where users can enter a single date or a date range.
- Wrap
DateInputSingle
andDateInputRange
inFormField
to provide the field with a visible label, help text, and a status message for validation feedback. This will ensure it complies with accessibility guidelines. You can find more information in the W3C form instructions. - The components clip text that extends beyond their visible area. All states have the same behavior—default, read-only, and disabled—whether or not the input has focus. To view the text in its entirety, the user can traverse the characters using the cursor.
the emptyReadOnlyMarker
prop to add a marker for empty read-only
fields.
This ensures it’s clear that a value is not necessary for the current
selection or configuration.
Key | Function |
---|---|
Tab |
|
Shift + Tab |
|
Enter |
|
Space |
|
Right Arrow | When the input area has focus: - If text is highlighted, the highlight is removed and the text cursor is positioned at the right edge of the highlight. - If the text cursor is displayed, it is positioned on the alternative side of the following character. If there is no following character, there is no effect. |
Left Arrow | When the input area has focus: - If text is in a highlighted state, Left Arrow removes the highlight and positions the text cursor at the left edge of the highlight. - If the text cursor is visible, Left Arrow positions it on the alternative side of the preceding character. If there's no preceding character, there's no effect. |
Shift + Left Arrow / Shift + Right Arrow | When the input area has focus, drags selection over text characters, one at a time. |
Backspace | When the input area has focus and: - Text is highlighted, this action removes all highlighted characters. - The text cursor is positioned to the right of text, this action removes the preceding character. |
Alphanumeric / Special keys | When the input area has focus, this action inserts the relevant character at the position of the text cursor. |
Control + A / Command + A | This action highlights all strings within the field. |