Knit UI
GitHub

Playground

Loading playground…

Playground
<MonthLevelGroup
  month="2024-03-15"
/>

Examples

Default

A single month panel (the default).

Loading example…

DefaultSourceStorybook

Two Columns

Two months side by side — one month 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

Custom Label Format

A custom month label format via dayjs tokens.

Loading example…

Custom Label FormatSourceStorybook

Bounded

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

Loading example…

BoundedSourceStorybook

Per Day Props

Per-day customization via getDayProps — the "explicit per-item beats sugar" callback (#7), forwarded to every panel. Here it disables the 15th.

Loading example…

Per Day PropsSourceStorybook

Static

Static (non-interactive) display cells via the static prop.

Loading example…

StaticSourceStorybook

Props

PropTypeDefaultDescription
month requiredstring2024-03-15Month of the first (left-most) panel, any date within it (`YYYY-MM-DD`).
disabled systemboolean | undefined——
excludeDate((date: DateStringValue) => boolean) | undefined—Predicate marking a day disabled.
firstDayOfWeekDayOfWeek | undefined`DatesProvider` (1)First weekday of each row, `0` (Sunday) … `6` (Saturday).
fullWidth systemboolean | undefinedfalseStretch the group (and its panels) to the full width of its container.
getDayAriaLabel((date: DateStringValue) => string) | undefined—Assigns each `Day` an `aria-label` based on its date.
getDayProps((date: DateStringValue) => Partial<DayProps>) | undefined—Passes props down to every `Day` (wins over `styles.day`).
hasNextLevelboolean | undefinedtrueWhether the level button can zoom out to the next level.
headerControlsOrderCalendarHeaderControlName[] | undefined['previous', 'level', 'next']Order in which the controls are rendered.
hideOutsideDatesboolean | undefinedfalseHide days outside the current month.
hideWeekdaysboolean | undefinedfalseHide the weekday header row.
highlightTodayboolean | undefinedfalseHighlight today with a border.
levelControlAriaLabelstring | ((month: DateStringValue) => string) | undefined—Level control `aria-label`, or a function resolving it from each panel's month.
localestring | undefined—dayjs locale; falls back to `DatesProvider`.
maxDatestring | Date | undefined—Maximum selectable date.
minDatestring | Date | undefined—Minimum selectable date.
monthLabelFormatDateLabelFormat | undefined'MMMM YYYY'dayjs format for the month label, or a function returning it.
nextDisabledboolean | undefinedfalseDisables the next control.
nextIconReactNode—Replace the next-button icon.
nextLabelstring | undefined—Next button `aria-label`.
numberOfColumnsnumber | undefined1Number of month panels to display next to each other.
onLevelClick(() => void) | undefined—Called when the level button is pressed.
onNext(() => void) | undefined—Called when the next button is pressed.
onPrevious(() => void) | undefined—Called when the previous button is pressed.
previousDisabledboolean | undefinedfalseDisables the previous control.
previousIconReactNode—Replace the previous-button icon.
previousLabelstring | undefined—Previous button `aria-label`.
renderDayRenderDay | undefined—Custom renderer for each day's content.
shadow system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined——
size systemCalendarSize | undefined'md'Width/font of the header controls and day cells.
staticboolean | undefinedfalseRender days as static (non-interactive) display cells.
theme systemThemeName | null | undefined—Applies a theme to this element
weekdayFormatDateLabelFormat | undefined'dd'dayjs format for weekday names, or a custom renderer.
weekendDaysDayOfWeek[] | undefined`DatesProvider` ([0, 6])Indices of weekend days.
withCellSpacingboolean | undefinedtrueSeparate cells/rows with spacing.
withWeekNumbersboolean | undefinedfalseDisplay a leading week-number column.
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.

Edit this page on GitHub