TimePicker
A time input component for selecting and editing time values. Perfect for scheduling, time tracking, and any scenario requiring precise time input.
Import
import { TimePicker } from "@sparrowengg/twigs-react";Usage
const TimePickerExample = () => {
return (
<Box css={{ display: "flex", flexDirection: "column", gap: "$4" }}>
<TimePicker label="Select time" />
<TimePicker label="24 Hour Time" hourCycle={24} />
<TimePicker label="Hour and Minute" granularity="minute" />
</Box>
);
};Props
TimePicker
| Prop | Type | Default |
|---|---|---|
label? | string | - |
value? | TimeValue | - |
defaultValue? | TimeValue | - |
onChange? | (value: TimeValue) => void | - |
hourCycle? | 12 | 24 | 24 |
granularity? | 'hour' | 'minute' | 'second' | 'minute' |
isDisabled? | boolean | false |
isReadOnly? | boolean | false |
isRequired? | boolean | false |
autoFocus? | boolean | false |
placeholderValue? | TimeValue | - |
minValue? | TimeValue | - |
maxValue? | TimeValue | - |
step? | number | - |
formatOptions? | Intl.DateTimeFormatOptions | - |
locale? | string | - |
description? | string | - |
errorMessage? | string | - |
validationState? | 'valid' | 'invalid' | - |
css? | object | - |
DatePicker
Interactive date selection component with calendar popover. Perfect for forms requiring date input with customizable formatting and validation options.
Text
A versatile text component for displaying content with consistent typography. Perfect for headings, body text, captions, and labels with customizable sizes, weights, and truncation options.