Knit UI
GitHub

Playground

Loading playground…

Playground
<TimeGrid
  size="sm"
  format="24h"
/>

Examples

Default

Default uncontrolled grid.

Loading example…

DefaultSourceStorybook

Twelve Hour

12h clock with AM/PM labels.

Loading example…

Twelve HourSourceStorybook

With Seconds

Seconds shown in each label.

Loading example…

With SecondsSourceStorybook

Bounded

Bounded + disabled — controls outside [minTime, maxTime] or listed in disableTime are disabled.

Loading example…

BoundedSourceStorybook

Allow Deselect

Deselectable — re-pressing the active control clears it.

Loading example…

Allow DeselectSourceStorybook

Styled

Per-slot styles sugar — recolor the labels and add a denser grid.

Loading example…

StyledSourceStorybook

Sizes

Every size token.

Loading example…

SizesSourceStorybook

Props

PropTypeDefaultDescription
data requiredstring[]Time data in 24h format to display, e.g. `['10:00', '18:30', '22:00']`. Values must be unique.
allowDeselectboolean | undefinedfalseWhether the active option can be deselected by clicking it again.
amPmLabelsTimePickerAmPmLabels | undefined{ am: 'AM', pm: 'PM' }Labels used for am/pm values.
defaultValuestring | null | undefinedUncontrolled component default value.
disabled systemboolean | undefinedIf set, all controls are disabled.
disableTimestring[] | ((time: string) => boolean) | undefinedArray of time values, or a predicate, used to disable controls.
formatTimePickerFormat | undefined
24h · 12h
'24h'Clock display mode.
getControlProps((time: string) => TimeGridControlPassthrough) | undefinedA function to pass props down to a control based on its time value (wins over `styles.control`).
maxTimestring | undefinedAll controls after this time are disabled.
minTimestring | undefinedAll controls before this time are disabled.
onChange((value: string | null) => void) | undefinedCalled when the value changes.
shadow system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined
simpleGridProps(Omit<GetFinalProps<RNTamaguiViewNonStyleProps, StackStyleBase, { shadow?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined; }>, keyof SimpleGridProps> & SimpleGridProps) | undefined{ cols: 3, spacing: 'xs' }Props passed down to the underlying `SimpleGrid`.
size systemCalendarSize | undefined
xs · sm · md · lg · xl
'sm'Control size.
styles systemSlotStyles<TimeGridStyles> | undefinedPer-slot style sugar — props spread onto the matching styled part.
theme systemThemeName | null | undefinedApplies a theme to this element
valuestring | null | undefinedControlled component value.
withSecondsboolean | undefinedfalseWhether the seconds part is displayed.

Style slots

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

SlotUsage
controlstyles={{ control: { … } }}
gridstyles={{ grid: { … } }}
labelstyles={{ label: { … } }}
rootstyles={{ root: { … } }}
Accessibility & DOM props (2)
PropType
keyKey | null | undefined
refRef<TamaguiElement> | undefined

Plus 497 inherited style props from Box — the full Tamagui/React Native style surface, including token shorthands like p, mx, bg and c. See Tokens for the scales they accept, or the full list.