yarn add @twilio-paste/time-picker - or - yarn add @twilio-paste/core
import {TimePicker, formatReturnTime} from '@twilio-paste/core/time-picker';
import {Label} from '@twilio-paste/core/label';
import {HelpText} from '@twilio-paste/core/helptext';
const TimePickerExample = () => {
return (
<>
<Label htmlFor="foo" required>
Start time
</Label>
<TimePicker
aria-describedby="foo_text"
id="foo"
name="foo"
onChange={(evt) => formatReturnTime(evt.target.value, 'hh:mm aa')}
required
/>
<HelpText id="foo_text">Select a time.</HelpText>
</>
);
};
element
Overrides the default element name to apply unique styles with the Customization Provider.
- Type
any
- Default
TIMEPICKER
Inherited props
Paste components will often extend native HTML elements and as a result will inherit or extend their available properties. Below is a list of the props this component has inherited and are also available to use.