Knit UI
GitHub

Playground

Loading playground…

Playground
<MonthPicker />

Examples

Default

Single month selection.

Loading example…

DefaultSourceStorybook

Range

Range of months (type="range").

Loading example…

RangeSourceStorybook

Multiple

Multiple months toggled into an array.

Loading example…

MultipleSourceStorybook

Props

PropTypeDefaultDescription
allowDeselect(Type extends "default" ? boolean : never) | undefinedWhether the user can deselect a date by clicking it again — `type="default"` only.
allowSingleDateInRange(Type extends "range" ? boolean : never) | undefinedWhether a single day can be selected as a range — `type="range"` only.
ariaLabelsCalendarAriaLabels | undefined`aria-label`s for the controls on the different levels.
columnsToScrollnumber | undefined`numberOfColumns`Number of columns to scroll with the next/prev buttons.
datestring | Date | undefinedDisplayed date in controlled mode.
decadeLabelFormatDecadeLabelFormat | undefined'YYYY'dayjs format for the decade label, or a function returning it.
defaultDatestring | Date | undefinedInitial displayed date in uncontrolled mode.
defaultLevelCalendarLevel | undefinedInitial displayed level in uncontrolled mode.
defaultValueDatePickerValue<Type, DateValue> | undefinedDefault value for uncontrolled component.
disabled systemboolean | undefined
fullWidth systemboolean | undefinedfalseStretch the list (and its controls) to the full width of its container.
getMonthControlProps((date: DateStringValue) => Partial<PickerControlProps>) | undefinedPasses props down to each month `PickerControl`, keyed by date (wins over `styles.control`).
getYearControlProps((date: DateStringValue) => Partial<PickerControlProps>) | undefinedPasses props down to each year `PickerControl`, keyed by date (wins over `styles.control`).
levelCalendarLevel | undefinedCurrent displayed level in controlled mode.
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.
maxLevelCalendarLevel | undefined'decade'Max level the user can zoom out to.
minDatestring | Date | undefinedMinimum possible date in `YYYY-MM-DD` format or a `Date` object.
monthsListFormatstring | undefined'MMM'dayjs format for the month labels.
nextLabelstring | undefinedNext-button `aria-label`.
numberOfColumnsnumber | undefined1Number of columns displayed next to each other.
onChange((value: DatePickerValue<Type, string>) => void) | undefinedCalled when value changes.
onDateChange((date: DateStringValue) => void) | undefinedCalled when the displayed date changes.
onLevelChange((level: MonthPickerLevel) => void) | undefinedCalled when the displayed level changes.
onMonthSelect((date: DateStringValue) => void) | undefinedCalled when a month is selected.
onMouseLeave((event: unknown) => void) | undefinedCalled when the pointer leaves the calendar root (web hover; used by range pickers to clear the hover preview). Cross-platform — the event type is opaque, never a DOM event; Tamagui no-ops it on native.
onNextDecade((date: DateStringValue) => void) | undefinedCalled when the next-decade button is clicked.
onNextYear((date: DateStringValue) => void) | undefinedCalled when the next-year button is clicked.
onPreviousDecade((date: DateStringValue) => void) | undefinedCalled when the previous-decade button is clicked.
onPreviousYear((date: DateStringValue) => void) | undefinedCalled when the previous-year button is clicked.
presetsMonthPickerPreset<Type>[] | undefinedPredefined values to pick from.
previousLabelstring | undefinedPrevious-button `aria-label`.
refRef<TamaguiElement> | undefined
shadow system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined
size systemCalendarSize | undefined'md'Width/font of the controls.
theme systemThemeName | null | undefinedApplies a theme to this element
typeDatePickerType | Type | undefinedPicker type: `range`, `multiple` or `default`.
valueDatePickerValue<Type, DateValue> | undefinedValue for controlled component.
withCellSpacingboolean | undefinedtrueSeparate controls/rows with spacing.
yearLabelFormatDateLabelFormat | undefined'YYYY'dayjs format for the year label, or a function returning it.
yearsListFormatstring | undefined'YYYY'dayjs format for the year labels.

Plus 495 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.