Skip to content
Storybook

Date picker

Date field that opens a month calendar with Cancel / Apply. Single date or range.

Preview

React · live from the Storybook

HTML and CSS

The same component as plain HTML with pixels-ui.css, no framework needed.

Start date

Usage

  • Also accept typed dates; the calendar is a convenience.
  • LTR weeks start Monday; Arabic weeks start Sunday.

Installation

Included in the core files. No extra install.

HTML
<link rel="stylesheet" href="/css/pixels-tokens.css">
<link rel="stylesheet" href="/css/pixels-ui.css">
<script src="/js/pixels-ui.js" defer></script>

Examples

Range

data-px-datepicker="range". Pick a start, then an end.

Inline calendar

data-px-calendar renders the panel on its own.

API reference

Class / attributeTypeDescription
data-px-datepicker="single|range"attributeField that opens the calendar.
data-px-calendar="single|range"attributeInline calendar panel.
px-dayclassDay cell; aria-pressed when selected.

Figma properties

Date picker4 variants · page “Date picker”Open

Date field that opens the calendar panel. Accept typed dates in the user’s locale format; the calendar is a convenience, not the only input method.

PropertyTypeValues
StateVariantClosed Open
DirectionVariantLTR RTL
Date picker / Calendar4 variants · page “Date picker”Open

Month calendar panel with navigation, weekday header, day grid and Cancel / Apply. LTR weeks start Monday; Arabic weeks start Sunday and use Arabic-Indic digits. Grid uses role=grid; arrow keys move b…

PropertyTypeValues
TypeVariantSingle Range
DirectionVariantLTR RTL
Date picker / Day9 variants · page “Date picker”Open

One day cell. Range start/end keep a tinted half so the band reads as continuous; in RTL swap start/end. Disabled dates are struck through, not only greyed.

PropertyTypeValues
DateText“15”
StateVariantDefault Hover Selected Range start In range Range end Today Disabled Outside

Design tokens

Component tokens from the Figma Component collection. Override them to restyle just this component.

TokenAliasLight value
--px-date-picker-day-sizespacing-3636px
--px-date-picker-day-radiusradius-1212px
--px-date-picker-day-background-hovercolor-background-neutral-default#f2f4f7
--px-date-picker-day-background-selectedcolor-background-brand-default#2563eb
--px-date-picker-day-background-rangecolor-background-brand-subtle#eff6ff
--px-date-picker-radiusradius-1616px
--px-date-picker-paddingspacing-1212px
--px-date-picker-weekdaycolor-content-neutral-secondary#475467

Accessibility

  • Arrow keys move by day/week; Enter picks.
  • Disabled days are struck through, not only grey.