Knit UI
GitHub

Playground

Loading playground…

true
true
false
Playground
<MonthLevel
  month="2024-01-01"
  size="md"
  withNext
  withPrevious
  fullWidth={false}
  previousLabel="Previous month"
  nextLabel="Next month"
  levelControlAriaLabel="Month"
/>

Examples

Default

The default month level (header + the day grid).

Loading example…

DefaultSourceStorybook

Custom Label

A function monthLabelFormat overrides the default MMMM YYYY label.

Loading example…

Custom LabelSourceStorybook

Bounded

Bounded — minDate/maxDate auto-disable the prev/next controls at the edges.

Loading example…

BoundedSourceStorybook

Static

Static display month — non-interactive day cells, no week labels needed.

Loading example…

StaticSourceStorybook

Full Width

Full-width level — the header and grid fill the container.

Loading example…

Full WidthSourceStorybook

Styled Parts

Per-slot styles sugar — round the header controls and recolor the label.

Loading example…

Styled PartsSourceStorybook

Sizes

Every size from the shared xxs…xxl cell-metrics ladder.

Loading example…

SizesSourceStorybook

Props

PropTypeDefaultDescription
month requiredstring2024-01-01A date within the displayed month (`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 | undefinedfalseTake the full width of the 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 | undefinedMonthLevel control `aria-label`.
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 | undefinedNext monthNext button `aria-label`.
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 | undefinedPrevious monthPrevious 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
xxs · xs · sm · md · lg · xl · xxl
'md'Width/font of the header controls and day cells.
staticboolean | undefinedfalseRender days as static (non-interactive) display cells.
styles systemSlotStyles<MonthLevelStyles> | undefined—Per-slot style sugar — props spread onto the matching part (header + grid).
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.
withNextboolean | undefinedtrueRender the next control.
withPreviousboolean | undefinedtrueRender the previous control.
withWeekNumbersboolean | undefinedfalseDisplay a leading week-number column.

Style slots

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

SlotTargets
headerProps for the header bar (CalendarHeader root slot).
headerControlProps for each header prev/next control (CalendarHeader control slot).
headerIconProps for the header chevron glyphs (CalendarHeader icon slot).
headerLevelProps for the header level (label) control (CalendarHeader level slot).
headerLevelLabelProps for the header level label text (CalendarHeader levelLabel slot).
monthProps for the Month grid root (.Month) — style props only; month is owned.
rootProps for the level root column (.Frame).
Accessibility & DOM props (2)
PropType
keyKey | null | undefined
refRef<TamaguiElement> | undefined

Plus 498 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