Flutter docs
Default skin

TimePicker

To select/input a time.

When to use

By clicking the input box, you can select a time from a popup panel.

Examples

Basic

Click TimePicker, and then we could select or input a time in panel.

Three Sizes

The input box comes in three sizes: large, medium and small. Large is used in the form, while the medium size is the default.

disabled

A disabled state of the TimePicker.

interval option

Show stepped options by hourStep minuteStep secondStep.

12 hours

TimePicker of 12 hours format, with default format h:mm:ss a.

Time Range Picker

Use time range picker with TimePicker.RangePicker.

Status

Add status to TimePicker with status, which could be error or warning.

Custom semantic dom styling

You can customize the semantic dom style of TimePicker by passing objects/functions through classNames and styles.

Under Control

value and onChange should be used together,

Need Confirm

TimePicker will automatically determine whether to show a confirm button according to the picker property. You can also set the needConfirm property to determine whether to show a confirm button. When needConfirm is set, the user must click the confirm button to complete the selection. Otherwise, the selection will be submitted when the picker loses focus or select a time.

Hour and minute

While part of format is omitted, the corresponding column in panel will disappear, too.

Addon

Render addon contents to time picker panel's bottom.

Change on scroll

Use changeOnScroll and needConfirm to change the value when scrolling.

Variants

Variants of TimePicker, there are four variants: outlined filled borderless and underlined.

Prefix and Suffix

Custom prefix and suffixIcon.

API

TimePicker and TimePicker.RangePicker are exported from @ceebee/ui/client.

TimePicker

PropertyDescriptionTypeDefaultVersion
allowClearCustomize clear iconboolean | { clearIcon?: ReactNode }true5.8.0: Support object type
addonCalled from time picker panel to render an addon to its bottom, please use renderExtraFooter instead() => ReactNode--
cellRenderCustom rendering function for picker cells(current: number, info: { originNode: React.ReactElement, today: dayjs, range?: 'start' | 'end', subType: 'hour' | 'minute' | 'second' | 'meridiem' }) => React.ReactNode-5.4.0
changeOnScrollTrigger selection when scroll the columnbooleanfalse5.14.0
classNamesCustomize class for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, string> | (info: { props })=> Record<SemanticDOM, string>-—
defaultValueTo set default timedayjs-—
disabledDetermine whether the TimePicker is disabledbooleanfalse—
disabledTimeTo specify the time that cannot be selectedDisabledTime-4.19.0
formatTo set the time formatstringHH:mm:ss—
getPopupContainerTo set the container of the floating layer, while the default is to create a div element in bodyfunction(trigger)-—
hideDisabledOptionsWhether hide the options that can not be selectedbooleanfalse—
hourStepInterval between hours in pickernumber1—
inputReadOnlySet the readonly attribute of the input tag (avoids virtual keyboard on touch devices)booleanfalse—
minuteStepInterval between minutes in pickernumber1—
needConfirmNeed click confirm button to trigger value changeboolean-5.14.0
openWhether to popup panelbooleanfalse—
placeholderDisplay when there's no valuestring | \[string, string]Select a time—
placementThe position where the selection box pops upbottomLeft bottomRight topLeft topRightbottomLeft—
popupClassNameThe className of panel, please use classNames.popup insteadstring-—
popupStyleThe style of panel, please use styles.popup insteadCSSProperties-—
prefixThe custom prefixReactNode-5.22.0
previewValueWhen the user selects the time hover option, the value of the input field undergoes a temporary changefalse | hoverhover6.0.0
renderExtraFooterCalled from time picker panel to render some addon to its bottom() => ReactNode-—
secondStepInterval between seconds in pickernumber1—
showNowWhether to show Now button on panelboolean-4.4.0
sizeTo determine the size of the input box, the height of large and small, are 40px and 24px respectively, while default size is 32pxlarge | medium | small-—
statusSet validation status'error' | 'warning' | 'success' | 'validating'-4.19.0
stylesCustomize inline style for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, CSSProperties> | (info: { props })=> Record<SemanticDOM, CSSProperties>-—
suffixIconThe custom suffix iconReactNode-—
use12HoursDisplay as 12 hours format, with default format h:mm:ss abooleanfalse—
valueTo set timedayjs-—
variantVariants of pickeroutlined | borderless | filled | underlinedoutlined5.13.0 | underlined: 5.24.0
onCalendarChangeCallback function, can be executed when the start time or the end time of the range is changing. info argument is added in 4.4.0function(dates: \[dayjs, dayjs], dateStrings: \[string, string], info: { range:start|end })-—
onChangeA callback function, can be executed when the selected time is changingfunction(time: dayjs, timeString: string): void-—
onClearCallback when click the clear button() => void-6.5.0
onOpenChangeA callback function which will be called while panel opening/closing(open: boolean) => void-—
blur()Remove focus———
focus()Get focus———

RangePicker

PropertyDescriptionTypeDefaultVersion
disabledTimeTo specify the time that cannot be selectedRangeDisabledTime-4.19.0
orderOrder start and end timebooleantrue4.1.0