
Theme Switch Component
Components
An animated single-date or date-range picker with smooth calendar transitions, a rolling trigger label on hover, gliding hover highlights, and month and year navigation.
Date Picker opens a calendar popup from its trigger with a scale or fade entrance, and picks either a single date or a date range (the default). In range mode, wide screens (768px and up) show two months side by side, and the days between the start and the hovered end are previewed while the end is being chosen. The trigger label rolls up to a copy of itself on hover and shows the chosen date or range. Month changes can slide in the direction of travel or fade, while a shared highlight glides between dates so users can follow where they are. Month and year selectors let users jump directly instead of clicking repeatedly.
Configure single or range selection, the trigger icon, date format, the header (month and year, month only, year only, or a plain label) with how many years the year list covers, close on select, filled or outlined hover highlight, neighbouring-month days, a fixed six-week grid, highlighting today, disabling past dates, and whether the week starts on Sunday or Monday. Motion settings include the rolling label, a popup that grows from behind the trigger with a scale or fade entrance and adjustable start scale, slide, fade, or instant month changes with a slide distance, sliding arrows, and slide or fade hover highlights with glide duration and bounce. Seven themes come in light or dark mode.
A SaaS onboarding form can use Date Picker in single mode to collect a preferred start date. Past dates are disabled, and the trigger shows the chosen day so customers can confirm it at a glance.
A reporting dashboard can let analysts jump straight to a month and year, then pick the day whose activity they want to review, without typing an ambiguous date string.
An ecommerce checkout can offer it for preferred delivery dates, while the store’s availability rules decide which days are actually bookable.
Date Picker selects one date or one continuous range, so several unrelated dates need a multi-date calendar.
If users only need a year or a few preset periods, a simple select field is faster than a full calendar.
It isn’t a scheduling engine. Picking a day doesn’t confirm availability, so bookings with precise times need time controls and timezone-aware logic.
Keep opening, month navigation, and selection instant. Use lightweight transitions, use fixed six-week mode to avoid height shifts, and cancel in-progress animations during rapid navigation. Don’t animate anything while the calendar is closed.
Label the trigger and navigation controls, announce full dates and states, support keyboard movement between days, and return focus when the popup closes. Today, selection, focus, and hover must differ by more than colour. On mobile, use comfortable date cells and keep the popover inside the viewport, and with reduced motion replace slides, gliding, and rolling text with instant changes.
| Prop | Type | Default | Description |
|---|---|---|---|
theme | string | vscode | Colour palette, calendar included. The selected day and range take its primary colour. |
mode | string | dark | Light or dark version of the palette. Starts dark. |
selectionMode | string | range | Pick one date, or a start and an end date. A range shows two months side by side from tablet up. |
showIcon | boolean | true | Shows a calendar icon in the trigger button. |
rollingText | boolean | true | The button label rolls to a second copy on hover. |
dateFormat | string | PPP | How the chosen date is written in the trigger. |
fromBehind | boolean | true | The calendar grows out from behind the trigger instead of appearing below it. |
contentAnimation | string | scale | How the calendar appears: scales and fades, or only fades. |
startScale | number | 0.9 | Size the calendar starts from when it opens, as a fraction of full size. |
closeOnSelect | boolean | true | Closes the calendar as soon as a date is picked. For a range, once both ends are picked. |
captionLayout | string | dropdown | What the calendar header shows: month and year dropdowns, one of them, or a plain label. |
yearsBefore | number | 10 | How many years before this one the year dropdown goes back. Needs a Header with a year dropdown. |
yearsAfter | number | 10 | How many years after this one the year dropdown goes forward. Needs a Header with a year dropdown. |
monthAnimation | string | slide | How the days change when you move to another month. |
monthSlideDistance | number | 40 | How far the days slide when the month changes, in pixels. Needs Month animation set to Slide + fade. |
slideArrows | boolean | true | The month arrows nudge in the direction they move. |
hoverVariant | string | filled | Style of the day highlight: filled or outline. |
hoverAnimation | string | slide | How the highlight moves between days: slides or fades. |
hoverDuration | number | 0.25 | How long the highlight takes to glide between days, in seconds. |
hoverBounce | number | 0.15 | How much the highlight overshoots when gliding. 0 is no bounce. |
weekStartsOn | string | 0 | First day of the week shown in the calendar. |
onlyCurrentMonth | boolean | true | Hides days that belong to the previous or next month. |
fixedWeeks | boolean | true | Always shows six weeks so the calendar keeps the same height. |
disablePast | boolean | false | Greys out dates before today so they can't be picked. |
highlightToday | boolean | false | Gives today's date its own highlight. |
Date Picker is an animated React component that lets users select a single date or a date range through a popup calendar, with month and year navigation, animated hover and month transitions, and configurable calendar settings.
Yes. Range selection is the default: pick a start and an end, with the days in between previewed as you hover, and two months shown side by side on screens 768px and wider. Set selectionMode to single for one date. Several unrelated dates are not supported.
Yes. The header can show month and year dropdowns, so users choose a period directly instead of clicking the arrows repeatedly.
Yes. A date-fns format string controls how the selected date appears in the trigger, from written dates to compact numeric formats.
Yes. Disable past dates blocks days before today while leaving today and future dates available.
Yes. Calendar navigation, selection, and animation run inside a client-side component in React and Next.js applications.
Need a custom effect? Tell us what to create.