Knit UI
GitHub

Playground

Loading playground…

false
Playground
<TimeControlsList
  min={0}
  max={23}
  step={1}
  reversed={false}
  maxHeight={200}
  size="sm"
/>

Examples

Default

The hours column with a selected value (revealed on open).

Loading example…

DefaultSourceStorybook

Stepped

A minutes column stepped by 5.

Loading example…

SteppedSourceStorybook

Reversed

Descending order.

Loading example…

ReversedSourceStorybook

Styled Slots

Per-slot styles sugar — recolour every control via the control slot.

Loading example…

Styled SlotsSourceStorybook

Am Pm

The two-cell am/pm variant shown in the 12h dropdown.

Loading example…

Am PmSourceStorybook

Sizes

Every size token.

Loading example…

SizesSourceStorybook

Props

PropTypeDefaultDescription
max requirednumber23Largest value in the column.
min requirednumber0Smallest value in the column.
onSelect required(value: number) => void—Called with the pressed value.
reversed requiredboolean | undefinedfalseRender the column in descending order.
step requirednumber1Step between successive values.
value requirednumber | null—Currently selected value, or `null`.
getControlProps((value: number) => Partial<TimeControlProps<number>>) | undefined—Passes props down to each `TimeControl`, keyed by value (wins over `styles.control`).
maxHeightnumber | undefined200Max column height in px before it scrolls.
scrollAreaPropsScrollAreaProps | undefined—Props forwarded to the underlying `ScrollArea` (wins over `styles.root`).
size systemCalendarSize | undefined
xxs · xs · sm · md · lg · xl · xxl
'sm'Label font size.
styles systemSlotStyles<TimeControlsListStyles> | undefined—Per-slot style sugar — props spread onto the matching styled part.

Style slots

Every part of TimeControlsList can be styled through the styles prop. Explicit props on the component always win over slot styles.

SlotTargets
columnProps for the inner column (.Column).
controlProps for each control inside the column (.Control — the TimeControl leaf).
rootProps for the scroll viewport (.Frame).

Edit this page on GitHub