8
Components

Calendar

A versatile and accessible calendar component with support for single-day, multiple-day, and range selection modes.

Previews with Code

Example 1: Single-Day Selection Calendar

July 2025

Example 2: Multiple-Day Selection Calendar

July 2025

Example 3: Range Selection Calendar

July 2025

Installation

The Calendar component offers a flexible and accessible solution for date selection.

Quickly add the component using:

npx axionjs-ui add calendar

File Structure


Props

The Calendar component includes the following props:

PropTypeDefault
mode
"single" | "multiple" | "range"
"single"
selected
"Date | Date[] | DateRange"
-
onSelect
(date: Date | Date[] | DateRange) => void
-
className
string
-

Features

  • Multiple Selection Modes:
    • Supports single, multiple, and range selection.
  • Integration with React DayPicker:
    • A powerful and customizable date-picker library.
  • Customizable Styling:
    • Use the className prop to apply custom styles.
  • Accessibility:
    • Built with aria-live and region attributes for screen reader compatibility.

Accessibility

The Calendar component is built using the React DayPicker library, which provides excellent accessibility out of the box. Ensure meaningful labels and descriptions are provided for selected dates.


Conclusion

The Calendar component is a robust and flexible tool for

On this page