ClickorAltL

Dragto resize

Nord Design System SearchDeveloperDeveloperGetting startedUsing Web ComponentsWebfontsCDNLocalizationCSS Framework Legacy ESLint PluginWorking with AIFAQDesignDesignGetting startedFoundationsThemesBrand assetsToolsComponentsComponentsAccordion New Aside New Autocomplete New AvatarBadgeBanner Updated ButtonButton GroupCalendar Updated CardCheckbox Updated Collapsible New Combobox New Command MenuDate Picker Updated Date Range Picker New DividerDrawerDropdownEmpty StateField New FieldsetFilter Bar New FooterHeaderIconInput Updated Item New Kbd New LayoutMessageMeter New ModalNavigationNotificationNumber Field New Otp Field New Outline New Pagination New Popout Updated ProgressProgress BarQrcodeRadio Updated Range Updated Scroll Area New Segmented ControlSelect Updated SkeletonSpinnerStackTabTableTagTextarea Updated Time Picker New ToastToggle Updated TooltipTop BarTruncate New Visually HiddenDesign TokensDesign TokensTailwind CSSTailwind CSSBlocksBlocksTemplatesTemplatesIconsIconsPlaygroundPlaygroundLatest UpdatesLatest UpdatesChangelogChangelogMigration guidesMigration guides
GitHub

Calendar Updated

Open in Storybook

Lets users pick a date from a month grid, with optional minimum and maximum bounds.

Loading...

Usage

Calendar shows a month grid that people can navigate and pick a date from. It has built-in support for setting a minimum and maximum allowed date. Like Date Picker, dates are handled in ISO-8601 format (YYYY-MM-DD).

Copy code
import "@nordhealth/components/lib/Calendar"

Render a standalone calendar, optionally with an initial value:

Examples

Basic

With no attributes the calendar opens on the current month.

Minimum and maximum

Constrain the selectable range with min and max. Both take ISO-8601 dates and can be used together or on their own.

Range selection

Set range to select a start and end date instead of a single day. The first click sets the start, the second sets the end (the two are swapped if the second is earlier), and the days in between are highlighted with a live preview as you hover. Control or read the selection with range-start and range-end (both ISO-8601), and listen for the range-change event, which fires once a complete range is picked.

Multiple months New since Jul 6, 2026

Set months to show that many consecutive months side by side, starting from the focused month. Combined with range, a selection (and its hover preview) spans every visible month, and the navigation arrows slide the whole window — handy for picking a span that crosses months without paging. Rendered this way, Calendar is itself an inline range picker.

For a complete range-picking control — with presets, the two-month calendar in a popout and Apply/Cancel — use Date Range Picker, which composes Calendar in this mode.

Expanded

Set expand to make the calendar fill the inline size of its container.

Small

The size attribute accepts s and m (default).

Inline

Remove the calendar's drop shadow to embed it flush in the page rather than as a floating surface.

Change today

Override which date is treated as "today" with the today attribute, useful for testing or when the client clock can't be trusted.

Disabling days

Set the isDateDisabled property to a function that returns true for dates that can't be selected — here weekends are disallowed.

Highlighting days

Set the isDateHighlighted property to mark notable dates; return a string to give the highlight an accessible label.

Focus date event

Calendar fires a nord-focus-date event as the focused day changes during keyboard navigation, letting you react to the day a user is hovering before they commit to it.

RTL

Calendar follows the document or container direction. Toggle the direction to see the layout mirror.

Accessibility

  • Calendar manages keyboard navigation between days, so users can move through the grid and select a date with the keyboard alone.
  • Supply value, min, max and today in ISO-8601 format (YYYY-MM-DD) so the selected, bounded and current dates stay consistent for assistive technology.
  • Calendar is a date-selection control without its own label; when embedding it in a form, pair it with a Field and Field Label to give it an accessible name.
  • Listen for the change event to react to a date selection rather than polling the value.

API reference

Calendar

Calendar allows user to pick a date. It comes with built-in functionality that allows you to set a minimum and a maximum allowed date. Please note that the date must be passed in ISO-8601 format.

<nord-calendar></nord-calendar>

Props

PropertyAttribute Description TypeDefault
valuevalueThe selected date on the calendar. Must be in IS0-8601 format: YYYY-MM-DD.string''
firstDayOfWeekfirst-day-of-weekWhich day is considered first day of the week? 0 for Sunday, 1 for Monday, etc. Default is Monday.DaysOfWeek
minminMinimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD. This setting can be used alone or together with the max property.string | undefined
maxmaxMaximum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD. This setting can be used alone or together with the min property.string | undefined
todaytodayThe date that is considered today. Must be in IS0-8601 format: YYYY-MM-DD. If not set, the current local date of the user is used.string | undefined
expandexpandControls whether the calendar expands to fill the width of its container.booleanfalse
sizesizeControls the size of the calendar.'s' | 'm''m'
rangerangeOpt into range selection. When true, clicking selects a range start, and the next click selects the end (the two clicks are swapped if the second is earlier than the first). The in-range days are styled, and a hover preview shows the range that would result. A completed range fires range-change. This is off by default, so the calendar keeps its single-date behaviour (the value/change API) unless range is set.booleanfalse
rangeStartrange-startThe start of the selected range, in ISO-8601 format: YYYY-MM-DD. Only used when range is set. Pair with rangeEnd to control the selection.string | undefined
rangeEndrange-endThe end of the selected range, in ISO-8601 format: YYYY-MM-DD. Only used when range is set. Pair with rangeStart to control the selection.string | undefined
monthsmonthsThe number of consecutive months to display side by side, starting from the focused month. Defaults to 1. Useful with range for picking a span that crosses months without paging — the range and its hover preview span every visible month, and the navigation arrows slide the whole window. With more than one month the month/year dropdowns are replaced by static titles.number1

Methods

Method nameParameters Description
focus(options?: FocusOptions & { target: 'day' | 'month' }) => voidoptions: An object which controls aspects of the focusing process.Programmatically move focus to the calendar.
EventDetail TypeDescription
range-changeDateRangeSelectEventDispatched in range mode when a complete range (start and end) has been selected.
nord-focus-dateDateSelectEventDispatched when the calendar's focused date changes.
changeDateSelectEventDispatched when a date is selected and the value changes.

CSS Properties

CSS Custom Properties provide more fine grain control over component presentation. We advise utilizing existing properties on the component before using these.

PropertyDescriptionDefault
--n-calendar-border-radiusControls how rounded the corners are, using border radius tokens.var(--n-border-radius)
--n-calendar-box-shadowControls the surrounding shadow, using box shadow tokens.var(--n-box-shadow-popout)
--n-calendar-padding-blockControls the block padding of the calendar, using space tokens.var(--n-space-m)
--n-calendar-padding-inlineControls the inline padding of the calendar, using space tokens.var(--n-space-m)
--n-calendar-day-sizeControls the block and inline size of each day cell, using space tokens.var(--n-space-xl)
--n-calendar-day-font-sizeControls the font size of each day cell, using font size tokens.var(--n-font-size-m)
--n-calendar-select-label-font-sizeControls the font size of the month and year select labels, using font size tokens.var(--n-font-size-xl)
--n-calendar-nav-padding-inlineControls the inline padding of the previous and next month buttons.11px
--n-calendar-nav-gapControls the gap between the previous and next month buttons, using space tokens.var(--n-space-xs)
--n-calendar-header-margin-block-endControls the block-end margin of the calendar header, using space tokens.var(--n-space-m)
--n-calendar-header-padding-block-endControls the block-end padding of the calendar header, using space tokens.0
--n-calendar-header-gapControls the gap between the month/year selects and the navigation buttons, using space tokens.var(--n-space-s)
--n-calendar-inline-sizeControls the inline size of the calendar. Defaults to 100% when the expand attribute is set.max-content
Design guidelinesFor designers

Usage

This section includes guidelines for designers and developers about the usage of this component in different contexts.

Do

  • Use when the user needs to choose a single date or a date range.
  • Close calendar after a single date is selected, unless a range with a start and end date is required.

Don’t

  • Don’t use for entering date of birth. Use input component instead.
  • Don’t use for choosing a date that is over 10 years in the future or the past.

Keyboard accessibility

Calendar component is built to closely follow W3C Date Picker Dialog example with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.

Month/year buttons

  • Space, Enter: Changes the month and/or year displayed.

Calendar grid

  • Space, Enter: Selects a date.
  • Arrow up: Moves focus to the same day of the previous week.
  • Arrow down: Moves focus to the same day of the next week.
  • Arrow right: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.
  • Arrow left: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.
  • Home: Moves focus to the first day (e.g Monday) of the current week.
  • End: Moves focus to the last day (e.g. Sunday) of the current week.
  • Page Up: Changes the grid of dates to the previous month and sets focus on the same day of the same week.
  • Shift + Page Up: Changes the grid of dates to the previous year and sets focus on the same day of the same week.
  • Page Down: Changes the grid of dates to the next month and sets focus on the same day of the same week.
  • Shift + Page Down: Changes the grid of dates to the next year and sets focus on the same day of the same week.