Skip to content

Calendar ​

Individual day cell button within the Calendar

Default

Usage ​

tsx
import { Calendar, CalendarDayButton } from '@tryvienna/ui'

<Calendar
  mode="single"
  selected={date}
  onSelect={setDate}
  captionLayout="dropdown"
  fromYear={2020}
  toYear={2030}
/>

Examples ​

Default ​

Default
tsx
<Calendar
  mode="single"
  selected={date}
  onSelect={setDate}
  captionLayout="dropdown"
  fromYear={2020}
  toYear={2030}
/>

Range ​

Range
tsx
<Calendar
  mode="single"
  selected={date}
  onSelect={setDate}
  captionLayout="dropdown"
  fromYear={2020}
  toYear={2030}
/>
Dropdown
tsx
<Calendar
  mode="single"
  selected={date}
  onSelect={setDate}
  captionLayout="dropdown"
  fromYear={2020}
  toYear={2030}
/>

API Reference ​

Calendar ​

PropTypeDefaultDescription
classNames(Partial&lt;ClassNames&gt; & Partial&lt;DeprecatedUI&lt;string&gt;&gt;) | undefined-
showOutsideDaysbooleantrue
captionLayout"label" | "dropdown" | "dropdown-months" | "dropdown-years"label
buttonVariant"link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | nullghost
formattersPartial&lt;Formatters&gt; | undefined-
componentsPartial&lt;CustomComponents&gt; | undefined-

Also accepts all props from DayPicker.

CalendarDayButton ​

CalendarDayButton — Individual day cell button within the Calendar

PropTypeDefaultDescription
dayCalendarDay-
modifiersModifiers-

Also accepts all props from DayButton.

Data Attributes ​

Componentdata-slot
Calendar"calendar"
CalendarDayButton"calendar-day-button"