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) | undefinedPredicate 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) | undefinedAssigns each `Day` an `aria-label` based on its date.
getDayProps((date: DateStringValue) => Partial<DayProps>) | undefinedPasses 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 | undefineddayjs locale; falls back to `DatesProvider`.
maxDatestring | Date | undefinedMaximum selectable date.
minDatestring | Date | undefinedMinimum selectable date.
monthLabelFormatDateLabelFormat | undefined'MMMM YYYY'dayjs format for the month label, or a function returning it.
nextDisabledboolean | undefinedfalseDisables the next control.
nextIconReactNodeReplace the next-button icon.
nextLabelstring | undefinedNext monthNext button `aria-label`.
onLevelClick(() => void) | undefinedCalled when the level button is pressed.
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 monthPrevious button `aria-label`.
renderDayRenderDay | undefinedCustom 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> | undefinedPer-slot style sugar — props spread onto the matching part (header + grid).
theme systemThemeName | null | undefinedApplies 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.

SlotUsage
headerstyles={{ header: { … } }}
headerControlstyles={{ headerControl: { … } }}
headerIconstyles={{ headerIcon: { … } }}
headerLevelstyles={{ headerLevel: { … } }}
headerLevelLabelstyles={{ headerLevelLabel: { … } }}
monthstyles={{ month: { … } }}
rootstyles={{ root: { … } }}
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.