Skip to Content

Calendar

A date field component that allows users to enter and edit date.

November 2026
import { Calendar } from "@dapplelight/signet-ui/components/calendar"
import * as React from "react"

export function Demo() {
  const [date, setDate] = React.useState<Date | undefined>(new Date(2026, 10, 17))
  return (
    <Calendar
      mode="single"
      selected={date}
      onSelect={setDate}
      className="rounded-lg border"
    />
  )
}

Installation

npm i @dapplelight/signet-ui

Usage

import { Calendar } from "@dapplelight/signet-ui/components/calendar"
import { useState } from "react"

const [date, setDate] = useState<Date | undefined>(new Date(2026, 10, 17))

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

Examples

Range

November 2026
import { DateRange } from "@dapplelight/signet-lib/search"
import { Calendar } from "@dapplelight/signet-ui/components/calendar"
import { useState } from "react"

const [range, setRange] = useState<DateRange | undefined>({
  from: new Date(2026, 10, 10),
  to: new Date(2026, 10, 18),
})

<Calendar mode="range" selected={range} onSelect={setRange} />

Month and year dropdowns

November 2026
import { Calendar } from "@dapplelight/signet-ui/components/calendar"
import { useState } from "react"

const [date, setDate] = useState<Date | undefined>(new Date(2026, 10, 17))

<Calendar
  mode="single"
  selected={date}
  onSelect={setDate}
  captionLayout="dropdown"
  startMonth={new Date(2024, 0)}
  endMonth={new Date(2028, 11)}
/>

Disabled days

November 2026
import { Calendar } from "@dapplelight/signet-ui/components/calendar"
import { useState } from "react"

const [date, setDate] = useState<Date | undefined>(new Date(2026, 10, 17))

<Calendar
  mode="single"
  selected={date}
  onSelect={setDate}
  disabled={[{ dayOfWeek: [0, 6] }, { before: new Date(2026, 10, 17) }]}
/>

API Reference

Calendar

Built on react-day-picker v10, a peer dependency. Every DayPicker prop works; these are the ones Signet sets or adds.

PropTypeDefaultDescription
modesingle | multiple | range-Selection mode.
selectedDate | Date[] | DateRange-Selected value, shaped by mode.
onSelect(value) => void-Runs when the selection changes.
requiredbooleanfalseKeep a day selected: clicking the selected day does not clear it.
min / maxnumber-Fewest and most days in multiple or range mode.
month / defaultMonth / onMonthChangeDate / Date / (month: Date) => voidcurrent monthControl the visible month.
startMonth / endMonthDate-Limit how far the user can navigate.
numberOfMonthsnumber1Months shown side by side.
weekStartsOn0 to 6localeFirst day of the week; 0 is Sunday.
showWeekNumberbooleanfalseShow a week number column.
timeZonestringlocalIANA time zone the days are computed in.
showOutsideDaysbooleantrueShow days from adjacent months.
captionLayoutlabel | dropdown | dropdown-months | dropdown-yearslabelMonth caption style.
buttonVariantButton variantghostVariant of the previous and next buttons.
localeLocale-Locale for labels and the month dropdown.
disabledMatcher | Matcher[]-Days that cannot be picked.
classNamesPartial<ClassNames>-Overrides per slot, merged over the defaults.
componentsPartial<CustomComponents>-Replace parts such as DayButton.
classNamestring-Merged onto the root.

CalendarDayButton

The button each day renders. Exported for building a custom DayButton. Takes the DayButton props plus locale.