Navigated to /docs/ui/components/calendar

Calendar

Application-controlled month grid for date selection; month and year navigation are composed by the application.

Preview

A live, theme-aware example rendered with the published component.

Loading preview…

Import

Import the component from its dedicated entry point to keep the dependency and generated bundle explicit.

TSX
tsximport { Calendar } from "@tavojs/ui/calendar";

Normal Tavo.js applications load component styles through the Tavo.js UI plugin. If the application manages component CSS manually, also import @tavojs/ui/css/calendar.

When to use

Use it when

Use Calendar when an application needs an inline month grid and owns the visible month, year, selected date, and navigation controls.

Choose something else when

Use DatePicker for a form field with a trigger and floating calendar. Calendar does not provide built-in previous-month, next-month, month-select, or year-select controls.

Examples

Calendar example

TSX
tsximport { Calendar } from "@tavojs/ui/calendar";

export function CalendarExample1() {
  return (
    <>
      <Calendar />
    </>
  );
}

Common props and defaults

PropTypeDefaultDescription
classNamestring

Optional class hook applied to the public root element owned by the component.
sizeSize

md

Control scale: sm, md, or lg when supported. Applies to Calendar.
disabledboolean

false

Disables the control when supported. Applies to Calendar.
aria-*unknown

ARIA attributes are passed through for accessible labeling and state. Applies to Calendar.

Complete TypeScript API

Import from @tavojs/ui/calendar. Published exports: Calendar, CalendarProps.

CalendarProps

PropertyTypeRequiredDescription
childrenChild

No

Inherited children attribute accepted by Calendar.

classNamestring

No

Optional class hook applied to the public root element owned by the component.

sxSx

No

Inherited sx attribute accepted by Calendar.

idstring

No

Inherited id attribute accepted by Calendar.

rolestring

No

Inherited role attribute accepted by Calendar.

styleRecord<string, unknown>

No

Inherited style attribute accepted by Calendar.

titlestring

No

Inherited title attribute accepted by Calendar.

tabIndexnumber

No

Inherited tabIndex attribute accepted by Calendar.

hiddenboolean

No

Inherited hidden attribute accepted by Calendar.

disabledboolean

No

Disables the control when supported. Applies to Calendar.

onClickTavoEventHandler<MouseEvent>

No

Inherited onClick attribute accepted by Calendar.

onChangeTavoEventHandler<Event>

No

Inherited onChange attribute accepted by Calendar.

onInputTavoEventHandler<Event>

No

Inherited onInput attribute accepted by Calendar.

onKeyDownTavoEventHandler<KeyboardEvent>

No

Inherited onKeyDown attribute accepted by Calendar.

onFocusTavoEventHandler<FocusEvent>

No

Inherited onFocus attribute accepted by Calendar.

onBlurTavoEventHandler<FocusEvent>

No

Inherited onBlur attribute accepted by Calendar.

yearnumber

No

Inherited year attribute accepted by Calendar.

monthnumber

No

Inherited month attribute accepted by Calendar.

selectedstring

No

Inherited selected attribute accepted by Calendar.

minstring

No

Inherited min attribute accepted by Calendar.

maxstring

No

Inherited max attribute accepted by Calendar.

localestring

No

Inherited locale attribute accepted by Calendar.

onSelect(value: string) => void

No

Inherited onSelect attribute accepted by Calendar.

State ownership and DOM target

ConcernContract
StateNo component state contract is exposed; the application owns the rendered content and surrounding behavior.
DOM targetNative input attributes target the owned form control; wrapper-specific props stay on the documented component root.

Anatomy and related components

This component exposes one public component root rather than a compound member API.

Limitations

Use DatePicker for a form field with a trigger and floating calendar. Calendar does not provide built-in previous-month, next-month, month-select, or year-select controls.

Use only the documented props, entry points, and compound members. Internal DOM nesting and CSS class names can change without becoming part of the public component contract.

Accessibility

Form components pass through native attributes and should be paired with visible labels or accessible names.

  • Use Field, FormLabel, FormControlLabel, or aria-label for labeling.

  • Preserve native input semantics whenever possible.

  • Expose validation with error text and aria-invalid where relevant.

Component status

ContractCurrent value
Maturitystable
Categoryforms
Component import@tavojs/ui/calendar
Explicit CSS import@tavojs/ui/css/calendar
PreviewInteractive preview available on this page