Knit UI
GitHub

Playground

Loading playground…

Playground
<DecadeLevelGroup
  decade="2024-03-15"
/>

Examples

Default

A single decade panel (the default).

Loading example…

DefaultSourceStorybook

Two Columns

Two decades side by side — ten years apart, edge-only navigation controls.

Loading example…

Two ColumnsSourceStorybook

Large

Larger cells via the shared size ladder.

Loading example…

LargeSourceStorybook

Full Width

Stretched to the full width of its container.

Loading example…

Full WidthSourceStorybook

Bounded

Bounded by minDate/maxDate: the previous/next controls disable at the bounds and out-of-range year cells are disabled (delegated to YearsList).

Loading example…

BoundedSourceStorybook

Per Year Props

Per-year customization via getYearControlProps — the "explicit per-item beats sugar" callback (#7), forwarded to every panel. Here it disables the year 2025.

Loading example…

Per Year PropsSourceStorybook

Props

PropTypeDefaultDescription
decade requiredstring2024-03-15Decade of the first (left-most) panel, any date within it (`YYYY-MM-DD`).
decadeLabelFormatDecadeLabelFormat | undefined'YYYY'dayjs format for the decade label, or a function returning it.
disabled systemboolean | undefined
fullWidth systemboolean | undefinedfalseStretch the group (and its panels) to the full width of its container.
getYearControlProps((date: DateStringValue) => Partial<PickerControlProps>) | undefinedPasses props down to each year `PickerControl`, keyed by date (wins over `styles.control`).
headerControlsOrderCalendarHeaderControlName[] | undefined['previous', 'level', 'next']Order in which the controls are rendered.
levelControlAriaLabelstring | ((decade: DateStringValue) => string) | undefinedLevel control `aria-label`, or a function resolving it from each panel's decade.
localestring | undefineddayjs locale; falls back to the value defined in `DatesProvider`.
maxDatestring | Date | undefinedMaximum possible date in `YYYY-MM-DD` format or a `Date` object.
minDatestring | Date | undefinedMinimum possible date in `YYYY-MM-DD` format or a `Date` object.
nextDisabledboolean | undefinedfalseDisables the next control.
nextIconReactNodeReplace the next-button icon.
nextLabelstring | undefinedNext button `aria-label`.
numberOfColumnsnumber | undefined1Number of decade panels to display next to each other.
onNext(() => void) | undefinedCalled when the next button is pressed.
onPrevious(() => void) | undefinedCalled when the previous button is pressed.
previousDisabledboolean | undefinedfalseDisables the previous control.
previousIconReactNodeReplace the previous-button icon.
previousLabelstring | undefinedPrevious button `aria-label`.
shadow system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined
size systemCalendarSize | undefined'md'Width/font of the header controls and year cells.
theme systemThemeName | null | undefinedApplies a theme to this element
withCellSpacingboolean | undefinedtrueSeparate controls/rows with spacing.
yearsListFormatstring | undefined'YYYY'dayjs format for the year labels.
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.