Skip to content
Nana UI

Date Range

A date-range picker: a trigger showing the current range, and a popover with one or two month grids plus optional shortcut presets. The form value is the two ISO dates joined by a slash (2026-01-01/2026-01-31), which is what start/end serialise to. An incomplete range submits nothing.

Terminal window
npm install @nana-tec/ui-components
import "@nana-tec/ui-components/date-range";
<nana-date-range></nana-date-range>

Show a single calendar with months="1".

Constrain selectable dates with min / max, and offer quick ranges with presets.

PropertyTypeDefaultDescription
startstring''Range start, yyyy-mm-dd.
endstring''Range end, yyyy-mm-dd.
valuestringThe submitted form value: start/end. Setting it parses both ends back out. Empty while the range is incomplete, so a half-picked range submits nothing.
namestring''
disabledbooleanfalse
requiredbooleanfalse
minstring''Earliest selectable day, yyyy-mm-dd.
maxstring''Latest selectable day, yyyy-mm-dd.
labelstring''Field label rendered above the trigger.
helperTextstring''Assistive text below the trigger.
errorTextstring''Replaces the helper text and marks the field invalid.
invalidbooleanfalse
size'sm' | 'md' | 'lg''md'
placement'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'right''bottom-start'Where the panel sits relative to the trigger.
openbooleanfalseWhether the panel is open.
monthsnumber2Number of month grids shown side by side.
presetsbooleanfalseShow the shortcut list (Today, Last 7 days, This month, …).
clearablebooleanfalseOffer a control to clear the range.
localeBCP 47 tag for month/weekday names and the trigger’s date formatting.
firstDayOfWeeknumber1Which weekday starts the week; 0 = Sunday.
EventTypeDescription
nana-changeCustomEventThe range changed; detail: { value }. Fires only on a complete range.
nana-range-changeCustomEventThe range changed; detail: { value, start, end }
nana-focusCustomEventThe trigger gained focus
nana-blurCustomEventThe trigger lost focus
SlotDescription
triggerReplaces the built-in trigger button entirely.
empty-labelShown on the trigger when no range is selected.
VariableDefaultDescription
--nana-date-range-bgPanel background
--nana-date-range-radiusPanel corner radius
--nana-date-range-accentSelection colour
--nana-date-range-in-range-bgFill between the two endpoints
PartDescription
baseThe root element
triggerThe trigger button
panelThe popover panel
presetsThe preset shortcut list
calendarA single month grid
dayA day cell
  • Keyboard accessible
  • Screen-reader labels
  • Focus-visible states
  • ARIA roles and states
  • WCAG 2.2 AA contrast
Explore Date Range interactively Every state, prop, and edge case — with live controls — in Storybook.
View in Storybook