Timepicker
Timepicker
A timepicker is an autocomplete text input to capture a time.
BaseRequires ui:scrollerWrapper
Preview
About Timepicker
Implementation Notes and Requirements
A timepicker is used to select a single time. The component is using the combobox HTML structure and has the following markup requirements:
Desktop
- Add
.slds-is-opento the element with.slds-dropdown-triggerto invoke the dropdown that contains the list of time options. - The
.slds-has-focusmodifier class is required on the.slds-listbox__optionelement that has focus. - The
.slds-is-selectedmodifier class is required on the.slds-listbox__optionelement that has been selected.
Mobile
- When on mobile, we want to leverage the native timepicker by changing the
inputtype fromtexttotime - When switching
input type="text"toinput type="time"for mobile, we need to remove the ARIA attributes. The native rendering doesn't require these.- On the element with the class
slds-combobox, please removerole="combobox",aria-expanded, andaria-haspopup. - On the
inputthat we just addedtype="time"too, please removearia-controls,aria-autocomplete, androle="textbox".
- On the element with the class
Accessibility
Please follow the implementation guildelines found under Combobox
Overview of CSS Classes
| Selector | .slds-timepicker |
|---|---|
| Summary | Initializes a timepicker |
| Restrict | div |
| Variant | True |