NovaUI
Components

Calendar

A month calendar grid for selecting dates with navigation between months.

The Calendar component renders a month view with day cells, supporting single date selection, outside-day visibility, and month navigation. It uses date-fns for date calculations and is styled with Tailwind classes matching the design system.

Preview

January 2026
Su
Mo
Tu
We
Th
Fr
Sa
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14

Installation

npx novaui-cli add calendar

Dependencies

The Calendar requires the following peer dependency:

  • date-fns >= 3

Import

import { Calendar } from 'novaui-components'

Basic Usage

February 2026
Su
Mo
Tu
We
Th
Fr
Sa
1
2
3
4
5
6
7
import { useState } from 'react'
import { Calendar } from 'novaui-components'

export function BasicCalendar() {
  const [date, setDate] = useState<Date | undefined>(new Date())

  return (
    <Calendar
      mode="single"
      selected={date}
      onSelect={setDate}
    />
  )
}

Hide Outside Days

February 2026
2
3
4
export function CalendarNoOutsideDays() {
  const [date, setDate] = useState<Date | undefined>(new Date())

  return (
    <Calendar
      mode="single"
      selected={date}
      onSelect={setDate}
      showOutsideDays={false}
    />
  )
}

Props API

Calendar Props

PropTypeDefaultDescription
mode'single' | 'range' | 'multiple''single'Selection mode
selectedDate | Date[] | { from: Date; to: Date }-Currently selected date(s)
onSelect(date: Date | undefined) => void-Called when a date is selected
showOutsideDaysbooleantrueShow days from adjacent months
classNamestring-Additional CSS classes
classNamesRecord<string, string>-Custom classes for internal elements

Best Practices

  1. Use with a popover or dialog — wrap the Calendar in a popover for date-picker behavior
  2. Show outside days for context — users often need to see the surrounding dates for orientation
  3. Highlight today — the calendar automatically highlights today's date with bg-accent
  4. Provide month navigation — the built-in prev/next buttons make it easy to browse months
  • Input — pair with a text input for a full date picker

On this page