Mini Calendar Picker

Form
Navigation

Compact calendar with date selection and month navigation.

Preview

Compact calendar with date selection

March 2026
Su
Mo
Tu
We
Th
Fr
Sa

Controlled Component

Manage date state externally

March 2026
Su
Mo
Tu
We
Th
Fr
Sa

Selected: 3/21/2026

Props

Component API reference

PropTypeDefaultDescription
defaultValueDatenew Date()Initial selected date (uncontrolled)
valueDateControlled selected date
onValueChange(date: Date) => voidCallback when date is selected
onMonthChange(date: Date) => voidCallback when month changes
showTodayButtonbooleantrueShow today button in footer
showClearButtonbooleantrueShow clear button in footer
daysOfWeekstring[]['Su', 'Mo', ...]Custom day labels
classNamestringAdditional CSS classes

Usage

Import and implementation examples

import { MiniCalendarPicker } from '@/components/ui/mini-calendar-picker'
import { useState } from 'react'

// Basic usage
<MiniCalendarPicker />

// Controlled component
export function MyComponent() {
  const [selectedDate, setSelectedDate] = useState(new Date())

  return (
    <MiniCalendarPicker
      value={selectedDate}
      onValueChange={(date) => {
        setSelectedDate(date)
        console.log('Selected:', date)
      }}
      onMonthChange={(date) => {
        console.log('Month changed to:', date)
      }}
    />
  )
}

// Custom configuration
<MiniCalendarPicker
  defaultValue={new Date('2024-01-15')}
  showTodayButton={true}
  showClearButton={false}
  daysOfWeek={['S', 'M', 'T', 'W', 'T', 'F', 'S']}
  onValueChange={(date) => console.log('Selected:', date)}
/>

Features

Built-in functionality

  • Month navigation: Arrow buttons for previous/next month
  • Date selection: Visual feedback on selected date
  • Today button: Quick access to current date
  • Week day display: Customizable day labels (Su-Sa)
  • Adjacent month dates: Shows dates from previous/next month
  • Clear selection: Optional clear button
  • Controlled/uncontrolled: Works in both modes
  • Dark mode: Full dark mode support

Accessibility

Accessibility considerations

ARIA Attributes

role="grid" for calendar gridaria-label for navigation buttonsaria-selected for selected datearia-disabled for adjacent month dates

Keyboard Navigation

KeyAction
Arrow keysNavigate between dates
EnterSelect focused date
TabNavigate between controls

Notes

  • Screen readers announce date selection
  • Keyboard navigation through calendar grid
  • Clear focus indicators on all dates