
Theme Switch Component
Components
An animated date picker with smooth calendar transitions, rolling date labels, interactive hover highlights, and intuitive month and year navigation.
Date Picker opens a compact calendar from its trigger with a controlled entrance, and the trigger label rolls to the new date once a day is chosen. 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 the trigger icon, date format, filled or outlined hover highlight, neighbouring-month days, a fixed six-week grid, and the first day of the week. Motion settings include the rolling label, scale or fade popup entrances, slide, fade, or instant month changes, animated arrows, and glide duration and bounce for the highlight.
A SaaS onboarding form can use Date Picker to collect a preferred start date. Past dates are disabled, and the trigger rolls to 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 a single day, so date ranges or several unrelated dates need a range or 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 calendar date through an expandable popup, with month and year navigation, animated date feedback, and configurable calendar settings.
No. It is designed around choosing one calendar day. Date ranges and multiple independent selections are separate requirements.
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.