Skip to Content
Dashflow Logo

Calendar Component

A comprehensive guide to using the Calendar component from @dashflowx/core.


Overview

The Calendar component from @dashflowx/core provides a visual date picker interface with multiple variants and sizes. It's perfect for forms, booking systems, and scheduling applications.

Basic Usage

import { Calendar } from '@dashflowx/core'
export default function CalendarExample() {
return (
<Calendar
mode="single"
/>
)
}

Preview:

Selected: Sep 19, 2025

Props

PropTypeDefaultDescription
mode'single' | 'multiple' | 'range''single'The selection mode for the calendar
classNamestring''Additional CSS classes for styling
variant'default' | 'bordered' | 'filled' | 'outlined' | 'ghost' | 'gradient''default'Visual variant of the calendar
size'sm' | 'md' | 'lg' | 'xl''md'Size of the calendar component

Variants

The Calendar component supports multiple visual variants to match your design system:

Default

Selected: Sep 19, 2025

Bordered

Selected: Sep 19, 2025

Filled

Selected: Sep 19, 2025

Outlined

Selected: Sep 19, 2025

Ghost

Selected: Sep 19, 2025

Gradient

Selected: Sep 19, 2025

Sizes

Small Size

<Calendar size="sm" />

Preview:

Selected: Sep 19, 2025

Medium Size (Default)

<Calendar size="md" />

Preview:

Selected: Sep 19, 2025

Large Size

<Calendar size="lg" />

Preview:

Selected: Sep 19, 2025

Extra Large Size

<Calendar size="xl" />

Preview:

Selected: Sep 19, 2025

Selection Modes

Single Selection

<Calendar mode="single" />

Preview:

Selected: Sep 19, 2025

Multiple Selection

<Calendar mode="multiple" />

Preview:

Range Selection

<Calendar mode="range" />

Preview:

Examples

Basic Calendar

<Calendar />

Preview:

Selected: Sep 19, 2025

Custom Styling

<Calendar
variant="bordered"
size="lg"
className="my-4"
/>

Preview:

Selected: Sep 19, 2025

Best Practices

  1. Choose the right mode: Use single for simple date selection, multiple for selecting several dates, and range for date ranges.

  2. Select appropriate variants: Use variants that match your design system and provide good contrast for accessibility.

  3. Consider sizing: Use sm for compact spaces, md for standard forms, and lg/xl for prominent displays.

  4. Accessibility: The component includes proper ARIA labels and keyboard navigation support.

Accessibility Features

  • Keyboard Navigation: Full keyboard support for navigation and selection
  • Screen Reader Support: Proper ARIA labels and descriptions
  • Focus Management: Clear focus indicators and logical tab order
  • High Contrast: Variants designed for good contrast ratios
Edit this page on GitHub