Date & time
These components use Reka’s date values and draw every control in the page; none of them opens a native date or time popup. Each example starts empty, shows the current month or year, prints its model under the control, and has its own NwProvider with locale="en-US". The provider’s locale sets the segment order, month and weekday names, and the first day of the week.
Every root accepts a class that is merged with tailwind-merge (HTMLAttributes['class'], unset by default). Each root extends its Reka *RootProps and forwards the remaining props and declared emits, and v-model listens to update:modelValue. The tables list the wrapper’s own props, its defaults and the forwarded props you will use most. They do not copy Reka’s full root interfaces.
Values are DateValue objects from @internationalized/date, not JS Date objects or ISO strings. Use a CalendarDate for a date without a time. TimeValue covers Reka’s time values, including Time. A DateRange has start and end dates, and either can be undefined while the range is incomplete; a TimeRange has the same shape with time values. The examples type their refs with the wrapper’s own props (NwDatePickerProps['modelValue']) and never construct a date. If your app does construct dates, install @internationalized/date and keep controlled values in a shallowRef.
Each anatomy block shows the parts the wrapper puts in its default slot. It shows how they nest, not a complete custom implementation: a custom grid also needs the dates, rows, segments and bindings that the root’s slot provides.
NwCalendar
Section titled “NwCalendar”NwCalendar wraps Reka CalendarRoot and fills its default slot with a header (previous, heading, next), a weekday row and one date grid per visible month. Use it when the calendar stays on screen. Selecting a date in the demo updates the readout below it.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
29 | 30 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 1 | 2 |
Maintenance: none
<script setup lang="ts">import { shallowRef } from 'vue'import { NwCalendar, NwProvider, type NwCalendarProps } from '@nyxwire/vue'
const value = shallowRef<NwCalendarProps['modelValue']>()</script>
<template> <NwProvider locale="en-US"> <div class="grid gap-3"> <NwCalendar v-model="value" calendar-label="Relay maintenance date" /> <p class="m-0 text-sm text-fg-muted" role="status"> Maintenance: {{ value?.toString() ?? 'none' }} </p> </div> </NwProvider></template>Anatomy
Section titled “Anatomy”<NwCalendar> <NwCalendarHeader> <NwCalendarPrev /><NwCalendarHeading /><NwCalendarNext /> </NwCalendarHeader> <NwCalendarGrid> <NwCalendarGridHead><NwCalendarGridRow><NwCalendarHeadCell /></NwCalendarGridRow></NwCalendarGridHead> <NwCalendarGridBody><NwCalendarGridRow> <NwCalendarCell><NwCalendarCellTrigger /></NwCalendarCell> </NwCalendarGridRow></NwCalendarGridBody> </NwCalendarGrid></NwCalendar>| Prop | Type | Default | Effect |
|---|---|---|---|
disableDaysOutsideCurrentView |
boolean |
true |
Disables dates outside the displayed month |
modelValue |
DateValue | DateValue[] | null |
unset | Selected date(s) |
defaultValue |
DateValue |
unset | Initial selection |
multiple |
boolean |
false |
Multiple selected dates |
numberOfMonths |
number |
1 |
Visible months |
calendarLabel |
string |
unset | Accessible calendar label |
minValue, maxValue |
DateValue |
unset | Selectable bounds |
isDateDisabled, isDateUnavailable |
(date: DateValue) => boolean |
unset | Date restrictions |
disabled, readonly, initialFocus |
boolean |
false |
Interaction lock / read-only / focus on mount |
The other CalendarRootProps and emits pass through. placeholder sets which month is shown, independently of the selection; defaultPlaceholder sets the first one shown. The uncomposed NwCalendarRoot is exported too. NwCalendarCell marks a cell aria-disabled and data-disabled when its date is disabled, unavailable or outside the current view, so those days dim and ignore the pointer.
Keyboard and accessibility. ArrowLeft and ArrowRight move one day, ArrowUp and ArrowDown one week, PageUp and PageDown one month, and Home and End go to the start or end of the week. Enter or Space selects the focused day. Dates outside the bounds and unavailable dates cannot be selected. The previous and next buttons are named “Previous month” and “Next month”. Pass calendar-label to name the grid, and set the provider’s locale to control weekday names and the first day of the week.
NwRangeCalendar
Section titled “NwRangeCalendar”NwRangeCalendar wraps Reka RangeCalendarRoot with the same grid layout and selects a start and an end date. The days between the two endpoints get the range fill.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
29 | 30 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 1 | 2 |
Freeze: … to …
<script setup lang="ts">import { shallowRef } from 'vue'import { NwRangeCalendar, NwProvider, type NwRangeCalendarProps } from '@nyxwire/vue'
const value = shallowRef<NwRangeCalendarProps['modelValue']>()</script>
<template> <NwProvider locale="en-US"> <div class="grid gap-3"> <NwRangeCalendar v-model="value" calendar-label="Deploy freeze window" /> <p class="m-0 text-sm text-fg-muted" role="status"> Freeze: {{ value?.start?.toString() ?? '…' }} to {{ value?.end?.toString() ?? '…' }} </p> </div> </NwProvider></template>Anatomy
Section titled “Anatomy”<NwRangeCalendar> <NwRangeCalendarHeader> <NwRangeCalendarPrev /><NwRangeCalendarHeading /><NwRangeCalendarNext /> </NwRangeCalendarHeader> <NwRangeCalendarGrid> <NwRangeCalendarGridHead><NwRangeCalendarGridRow><NwRangeCalendarHeadCell /></NwRangeCalendarGridRow></NwRangeCalendarGridHead> <NwRangeCalendarGridBody><NwRangeCalendarGridRow> <NwRangeCalendarCell><NwRangeCalendarCellTrigger /></NwRangeCalendarCell> </NwRangeCalendarGridRow></NwRangeCalendarGridBody> </NwRangeCalendarGrid></NwRangeCalendar>| Prop | Type | Default | Effect |
|---|---|---|---|
disableDaysOutsideCurrentView |
boolean |
true |
Disables outside-month dates |
modelValue |
DateRange | null |
uncontrolled | Controlled range |
defaultValue |
DateRange |
{ start: undefined, end: undefined } |
Initial range |
numberOfMonths |
number |
1 |
Visible month count |
calendarLabel |
string |
unset | Accessible name |
allowNonContiguousRanges |
boolean |
false |
Allows ranges containing unavailable dates |
maximumDays |
number |
unset | Maximum range length |
fixedDate |
'start' | 'end' |
unset | Fixed endpoint |
minValue, maxValue |
DateValue |
unset | Selectable bounds |
The other RangeCalendarRootProps and emits pass through, including the date matchers and the disabled and readonly states. The first click sets the start, the second sets the end, and the model is emitted once the range is complete.
Keyboard and accessibility. Navigation works as in NwCalendar: arrows move by day and week, PageUp and PageDown by month, and Enter selects an endpoint. Keep the header controls and the grid parts together when you compose your own layout, so the named navigation buttons stay in place.
NwDateField
Section titled “NwDateField”NwDateField wraps Reka DateFieldRoot and renders one NwDateFieldInput per segment, in the order the provider’s locale uses. The field gets a wire edge while one of its segments has focus.
Expiry: none
<script setup lang="ts">import { shallowRef } from 'vue'import { NwDateField, NwProvider, type NwDateFieldProps } from '@nyxwire/vue'
const value = shallowRef<NwDateFieldProps['modelValue']>()</script>
<template> <NwProvider locale="en-US"> <div class="grid gap-3"> <NwDateField v-model="value" aria-label="Certificate expiry" /> <p class="m-0 text-sm text-fg-muted" role="status"> Expiry: {{ value?.toString() ?? 'none' }} </p> </div> </NwProvider></template>Anatomy
Section titled “Anatomy”<NwDateField> <NwDateFieldInput /> <!-- repeated for each segment, using its part and value --></NwDateField>| Prop | Type | Default | Effect |
|---|---|---|---|
size |
'sm' | 'md' | 'lg' |
'md' |
Field dimensions |
invalid |
boolean |
false |
Invalid appearance and aria-invalid |
modelValue |
DateValue | null |
unset | Controlled date |
defaultValue |
DateValue |
unset | Initial date |
minValue, maxValue |
DateValue |
unset | Valid bounds |
disabled, readonly |
boolean |
false |
Prevent interaction / editing |
The other DateFieldRootProps and emits pass through. The value is emitted only when every segment is filled.
Keyboard and accessibility. Give the field an aria-label or connect a label. Tab and the arrow keys move between segments. ArrowUp and ArrowDown step the focused segment, typing digits replaces it, and Backspace clears it. The locale decides the segment order. Disabled and read-only fields cannot be edited.
NwDateRangeField
Section titled “NwDateRangeField”NwDateRangeField wraps Reka DateRangeFieldRoot. It renders the start segments, a decorative en dash, then the end segments.
Lease: … to …
<script setup lang="ts">import { shallowRef } from 'vue'import { NwDateRangeField, NwProvider, type NwDateRangeFieldProps } from '@nyxwire/vue'
const value = shallowRef<NwDateRangeFieldProps['modelValue']>()</script>
<template> <NwProvider locale="en-US"> <div class="grid gap-3"> <NwDateRangeField v-model="value" aria-label="Lease start and end dates" /> <p class="m-0 text-sm text-fg-muted" role="status"> Lease: {{ value?.start?.toString() ?? '…' }} to {{ value?.end?.toString() ?? '…' }} </p> </div> </NwProvider></template>Anatomy
Section titled “Anatomy”<NwDateRangeField> <NwDateRangeFieldInput type="start" /> <!-- start segments --> <NwDateRangeFieldInput type="end" /> <!-- end segments --></NwDateRangeField>| Prop | Type | Default | Effect |
|---|---|---|---|
size |
'sm' | 'md' | 'lg' |
'md' |
Field dimensions |
invalid |
boolean |
false |
Invalid appearance and aria-invalid |
modelValue |
DateRange | null |
uncontrolled | Controlled endpoints |
defaultValue |
DateRange |
unset (empty endpoints internally) | Initial range |
minValue, maxValue |
DateValue |
unset | Date bounds |
disabled, readonly |
boolean |
false |
Interaction / editing lock |
The other DateRangeFieldRootProps and emits pass through. You can edit each endpoint without touching the other.
Keyboard and accessibility. Name the range as a whole. If you compose the inputs yourself, keep type="start" and type="end" on them and let Reka move focus between segments. The dash is hidden from assistive technology.
NwTimeField
Section titled “NwTimeField”NwTimeField wraps Reka TimeFieldRoot and renders an NwTimeFieldInput for each formatted time segment.
Failover: none
<script setup lang="ts">import { shallowRef } from 'vue'import { NwTimeField, NwProvider, type NwTimeFieldProps } from '@nyxwire/vue'
const value = shallowRef<NwTimeFieldProps['modelValue']>()</script>
<template> <NwProvider locale="en-US"> <div class="grid gap-3"> <NwTimeField v-model="value" :hour-cycle="24" aria-label="Failover time" /> <p class="m-0 text-sm text-fg-muted" role="status"> Failover: {{ value?.toString() ?? 'none' }} </p> </div> </NwProvider></template>Anatomy
Section titled “Anatomy”<NwTimeField> <NwTimeFieldInput /> <!-- repeated for each segment --></NwTimeField>| Prop | Type | Default | Effect |
|---|---|---|---|
size |
'sm' | 'md' | 'lg' |
'md' |
Field dimensions |
invalid |
boolean |
false |
Invalid appearance and aria-invalid |
modelValue |
TimeValue | null |
unset | Controlled time |
defaultValue |
TimeValue |
unset | Initial time |
hourCycle |
12 | 24 |
locale preference | Hour display |
granularity |
'hour' | 'minute' | 'second' |
'minute' |
Last displayed segment |
minValue, maxValue |
TimeValue |
unset | Time bounds |
disabled, readonly |
boolean |
false |
Interaction / editing lock |
The other TimeFieldRootProps and emits pass through. The demo uses 24-hour entry. Without hour-cycle, the locale decides, and a 12-hour field adds an AM/PM segment.
Keyboard and accessibility. Name the field with aria-label. ArrowUp and ArrowDown step the focused segment, and typing digits replaces it. A time value says nothing about time zones, so decide whether it means server time or local time before you store it.
NwTimeRangeField
Section titled “NwTimeRangeField”NwTimeRangeField wraps Reka TimeRangeFieldRoot for a start time and an end time, separated by an en dash.
Quiet hours: … to …
<script setup lang="ts">import { shallowRef } from 'vue'import { NwTimeRangeField, NwProvider, type NwTimeRangeFieldProps } from '@nyxwire/vue'
const value = shallowRef<NwTimeRangeFieldProps['modelValue']>()</script>
<template> <NwProvider locale="en-US"> <div class="grid gap-3"> <NwTimeRangeField v-model="value" :hour-cycle="24" aria-label="Quiet hours start and end" /> <p class="m-0 text-sm text-fg-muted" role="status"> Quiet hours: {{ value?.start?.toString() ?? '…' }} to {{ value?.end?.toString() ?? '…' }} </p> </div> </NwProvider></template>Anatomy
Section titled “Anatomy”<NwTimeRangeField> <NwTimeRangeFieldInput type="start" /> <!-- start segments --> <NwTimeRangeFieldInput type="end" /> <!-- end segments --></NwTimeRangeField>| Prop | Type | Default | Effect |
|---|---|---|---|
size |
'sm' | 'md' | 'lg' |
'md' |
Field dimensions |
invalid |
boolean |
false |
Invalid appearance and aria-invalid |
modelValue |
TimeRange | null |
uncontrolled | Controlled endpoints |
defaultValue |
TimeRange |
unset | Initial range |
hourCycle |
12 | 24 |
locale preference | Hour display |
granularity |
'hour' | 'minute' | 'second' |
'minute' |
Last displayed segment |
disabled, readonly |
boolean |
false |
Interaction / editing lock |
The other TimeRangeFieldRootProps and emits pass through. You can change the end without moving the start.
Keyboard and accessibility. Name the whole range, and keep type="start" and type="end" on the inputs when you compose them yourself. Segments follow the same keys as NwTimeField.
NwDatePicker
Section titled “NwDatePicker”NwDatePicker wraps Reka DatePickerRoot. It renders a segmented field with a calendar button and opens a portalled calendar dialog from that button.
Launch: none
<script setup lang="ts">import { shallowRef } from 'vue'import { NwDatePicker, NwProvider, type NwDatePickerProps } from '@nyxwire/vue'
const value = shallowRef<NwDatePickerProps['modelValue']>()</script>
<template> <NwProvider locale="en-US"> <div class="grid gap-3"> <NwDatePicker v-model="value" label="Launch date" trigger-label="Choose launch date" close-on-select /> <p class="m-0 text-sm text-fg-muted" role="status"> Launch: {{ value?.toString() ?? 'none' }} </p> </div> </NwProvider></template>Anatomy
Section titled “Anatomy”<NwDatePicker> <NwDatePickerAnchor> <NwDatePickerField> <NwDatePickerInput /> <NwDatePickerTrigger /> </NwDatePickerField> </NwDatePickerAnchor> <NwDatePickerContent> <NwDatePickerCalendar> <NwDatePickerHeader><NwDatePickerPrev /><NwDatePickerHeading /><NwDatePickerNext /></NwDatePickerHeader> <NwDatePickerGrid> <NwDatePickerGridHead><NwDatePickerGridRow><NwDatePickerHeadCell /></NwDatePickerGridRow></NwDatePickerGridHead> <NwDatePickerGridBody><NwDatePickerGridRow> <NwDatePickerCell><NwDatePickerCellTrigger /></NwDatePickerCell> </NwDatePickerGridRow></NwDatePickerGridBody> </NwDatePickerGrid> </NwDatePickerCalendar> </NwDatePickerContent></NwDatePicker>| Prop | Type | Default | Effect |
|---|---|---|---|
size |
'sm' | 'md' | 'lg' |
'md' |
Field dimensions |
invalid |
boolean |
false |
Field aria-invalid and styling |
label |
string |
'Date' |
Field and dialog name |
triggerLabel |
string |
'Open calendar' |
Trigger name |
modelValue, defaultValue |
DateValue |
unset | Controlled / initial selection |
closeOnSelect |
boolean |
false |
Close after selection |
defaultOpen, modal |
boolean |
false |
Initial popup state / modal behavior |
numberOfMonths |
number |
1 |
Calendar month count |
The other DatePickerRootProps and emits pass through, including v-model:open, the bounds and the unavailable-date matchers. The popup calendar disables days outside its current view. NwDatePickerContent defaults to align="start" and an 8px sideOffset, and it takes its name from label. NwDatePickerRoot, NwDatePickerArrow and NwDatePickerClose (named “Close calendar”) are exported for your own compositions.
Keyboard and accessibility. The field segments can be edited directly. The calendar button is named by trigger-label and opens a portalled dialog named by label. Inside it, the calendar keys apply. Escape closes the dialog and returns focus to the button. With close-on-select, picking a date emits it and closes the dialog.
NwDateRangePicker
Section titled “NwDateRangePicker”NwDateRangePicker wraps Reka DateRangePickerRoot. It renders a field with both endpoints and opens a portalled range calendar.
Window: … to …
<script setup lang="ts">import { shallowRef } from 'vue'import { NwDateRangePicker, NwProvider, type NwDateRangePickerProps } from '@nyxwire/vue'
const value = shallowRef<NwDateRangePickerProps['modelValue']>()</script>
<template> <NwProvider locale="en-US"> <div class="grid gap-3"> <NwDateRangePicker v-model="value" label="Incident window" trigger-label="Choose incident window" close-on-select /> <p class="m-0 text-sm text-fg-muted" role="status"> Window: {{ value?.start?.toString() ?? '…' }} to {{ value?.end?.toString() ?? '…' }} </p> </div> </NwProvider></template>Anatomy
Section titled “Anatomy”<NwDateRangePicker> <NwDateRangePickerAnchor> <NwDateRangePickerField> <NwDateRangePickerInput type="start" /> <NwDateRangePickerInput type="end" /> <NwDateRangePickerTrigger /> </NwDateRangePickerField> </NwDateRangePickerAnchor> <NwDateRangePickerContent> <NwDateRangePickerCalendar> <NwDateRangePickerHeader><NwDateRangePickerPrev /><NwDateRangePickerHeading /><NwDateRangePickerNext /></NwDateRangePickerHeader> <NwDateRangePickerGrid> <NwDateRangePickerGridHead><NwDateRangePickerGridRow><NwDateRangePickerHeadCell /></NwDateRangePickerGridRow></NwDateRangePickerGridHead> <NwDateRangePickerGridBody><NwDateRangePickerGridRow> <NwDateRangePickerCell><NwDateRangePickerCellTrigger /></NwDateRangePickerCell> </NwDateRangePickerGridRow></NwDateRangePickerGridBody> </NwDateRangePickerGrid> </NwDateRangePickerCalendar> </NwDateRangePickerContent></NwDateRangePicker>| Prop | Type | Default | Effect |
|---|---|---|---|
size |
'sm' | 'md' | 'lg' |
'md' |
Field dimensions |
invalid |
boolean |
false |
Field aria-invalid and styling |
label |
string |
'Date range' |
Field and dialog name |
triggerLabel |
string |
'Open calendar' |
Trigger name |
modelValue |
DateRange |
uncontrolled | Selected endpoints |
defaultValue |
DateRange |
{ start: undefined, end: undefined } |
Initial endpoints |
closeOnSelect |
boolean |
false |
Close on completed selection |
numberOfMonths |
number |
1 |
Visible months |
defaultOpen, modal |
boolean |
false |
Initial popup state / modal behavior |
The other DateRangePickerRootProps and emits pass through. The popup calendar disables days outside its current view, and its content defaults to align="start" and an 8px sideOffset. NwDateRangePickerClose adds an explicit close button for compositions that need one. On a narrow layout, keep number-of-months at 1.
Keyboard and accessibility. Each endpoint’s segments can be edited directly. The trigger opens a portalled dialog named by label. Escape closes it and returns focus to the trigger. Keep type="start" and type="end" on the inputs when you compose them yourself.
NwMonthPicker
Section titled “NwMonthPicker”NwMonthPicker wraps Reka MonthPickerRoot. It shows the twelve months of one year, with previous and next year buttons.
Jan | Feb | Mar | Apr |
May | Jun | Jul | Aug |
Sep | Oct | Nov | Dec |
Billing month: none
<script setup lang="ts">import { shallowRef } from 'vue'import { NwMonthPicker, NwProvider, type NwMonthPickerProps } from '@nyxwire/vue'
const value = shallowRef<NwMonthPickerProps['modelValue']>()</script>
<template> <NwProvider locale="en-US"> <div class="grid gap-3"> <NwMonthPicker v-model="value" calendar-label="Billing month" /> <p class="m-0 text-sm text-fg-muted" role="status"> Billing month: {{ value ? `${value.year}-${String(value.month).padStart(2, '0')}` : 'none' }} </p> </div> </NwProvider></template>Anatomy
Section titled “Anatomy”<NwMonthPicker> <NwMonthPickerHeader><NwMonthPickerPrev /><NwMonthPickerHeading /><NwMonthPickerNext /></NwMonthPickerHeader> <NwMonthPickerGrid><NwMonthPickerGridBody><NwMonthPickerGridRow> <NwMonthPickerCell><NwMonthPickerCellTrigger /></NwMonthPickerCell> </NwMonthPickerGridRow></NwMonthPickerGridBody></NwMonthPickerGrid></NwMonthPicker>| Prop | Type | Default | Effect |
|---|---|---|---|
modelValue |
DateValue | DateValue[] | null |
unset | Selected month(s) |
defaultValue |
DateValue |
unset | Initial selection |
calendarLabel |
string |
unset | Accessible calendar name |
multiple, preventDeselect |
boolean |
false |
Multiple selection / prevent deselection |
minValue, maxValue |
DateValue |
unset | Selection bounds |
isMonthDisabled, isMonthUnavailable |
(date: DateValue) => boolean |
unset | Month restrictions |
disabled, readonly, initialFocus |
boolean |
false |
Interaction lock / read-only / focus on mount |
The other MonthPickerRootProps and emits pass through. Selecting a month emits a date value in that month. Its day comes from the placeholder (today’s day by default), so read only year and month, as the demo does. The cells show short month names (“Jan”). Nyxwire names each cell with the short month and the year (“Jan 2026”), so the accessible name contains the visible word, as WCAG’s label-in-name rule requires. Reka would name it with the long month.
Keyboard and accessibility. Arrow keys move between months, and Enter or Space selects. The previous and next buttons are named “Previous year” and “Next year”. The grid is always on screen, so there is no Escape behavior. Name it with calendar-label.
NwMonthRangePicker
Section titled “NwMonthRangePicker”NwMonthRangePicker wraps Reka MonthRangePickerRoot and selects a start month and an end month.
Jan | Feb | Mar | Apr |
May | Jun | Jul | Aug |
Sep | Oct | Nov | Dec |
Retention: … to …
<script setup lang="ts">import { shallowRef } from 'vue'import { NwMonthRangePicker, NwProvider, type NwMonthRangePickerProps } from '@nyxwire/vue'
const value = shallowRef<NwMonthRangePickerProps['modelValue']>()</script>
<template> <NwProvider locale="en-US"> <div class="grid gap-3"> <NwMonthRangePicker v-model="value" calendar-label="Retention months" /> <p class="m-0 text-sm text-fg-muted" role="status"> Retention: {{ value?.start?.toString() ?? '…' }} to {{ value?.end?.toString() ?? '…' }} </p> </div> </NwProvider></template>Anatomy
Section titled “Anatomy”<NwMonthRangePicker> <NwMonthRangePickerHeader><NwMonthRangePickerPrev /><NwMonthRangePickerHeading /><NwMonthRangePickerNext /></NwMonthRangePickerHeader> <NwMonthRangePickerGrid><NwMonthRangePickerGridBody><NwMonthRangePickerGridRow> <NwMonthRangePickerCell><NwMonthRangePickerCellTrigger /></NwMonthRangePickerCell> </NwMonthRangePickerGridRow></NwMonthRangePickerGridBody></NwMonthRangePickerGrid></NwMonthRangePicker>| Prop | Type | Default | Effect |
|---|---|---|---|
modelValue |
DateRange | null |
uncontrolled | Selected month endpoints |
defaultValue |
DateRange |
{ start: undefined, end: undefined } |
Initial endpoints |
calendarLabel |
string |
unset | Accessible name |
maximumMonths |
number |
unset | Range length limit |
allowNonContiguousRanges, preventDeselect |
boolean |
false |
Unavailable-month ranges / deselection policy |
fixedDate |
'start' | 'end' |
unset | Fixed endpoint |
disabled, readonly, initialFocus |
boolean |
false |
Interaction lock / read-only / focus on mount |
The other MonthRangePickerRootProps and emits pass through, including the month matchers and bounds. The first selection sets the start month and the second sets the end. The cells use the same short-month names as NwMonthPicker.
Keyboard and accessibility. Keep Reka’s cell triggers when you customize the grid, because they carry focus and selection. Name the grid with calendar-label.
NwYearPicker
Section titled “NwYearPicker”NwYearPicker wraps Reka YearPickerRoot for values that only need a year, such as a fiscal or archive year.
2020 | 2021 | 2022 | 2023 |
2024 | 2025 | 2026 | 2027 |
2028 | 2029 | 2030 | 2031 |
Archive: none
<script setup lang="ts">import { shallowRef } from 'vue'import { NwYearPicker, NwProvider, type NwYearPickerProps } from '@nyxwire/vue'
const value = shallowRef<NwYearPickerProps['modelValue']>()</script>
<template> <NwProvider locale="en-US"> <div class="grid gap-3"> <NwYearPicker v-model="value" calendar-label="Archive year" /> <p class="m-0 text-sm text-fg-muted" role="status">Archive: {{ value?.year ?? 'none' }}</p> </div> </NwProvider></template>Anatomy
Section titled “Anatomy”<NwYearPicker> <NwYearPickerHeader><NwYearPickerPrev /><NwYearPickerHeading /><NwYearPickerNext /></NwYearPickerHeader> <NwYearPickerGrid><NwYearPickerGridBody><NwYearPickerGridRow> <NwYearPickerCell><NwYearPickerCellTrigger /></NwYearPickerCell> </NwYearPickerGridRow></NwYearPickerGridBody></NwYearPickerGrid></NwYearPicker>| Prop | Type | Default | Effect |
|---|---|---|---|
modelValue |
DateValue | DateValue[] | null |
unset | Selected year(s) |
defaultValue |
DateValue |
unset | Initial selection |
yearsPerPage |
number |
12 |
Years in a view |
calendarLabel |
string |
unset | Accessible name |
multiple, preventDeselect |
boolean |
false |
Multiple selection / deselection policy |
isYearDisabled, isYearUnavailable |
(date: DateValue) => boolean |
unset | Year restrictions |
disabled, readonly, initialFocus |
boolean |
false |
Interaction lock / read-only / focus on mount |
The other YearPickerRootProps and emits pass through, including the date bounds. Choosing a year emits a date value in that year. Its month and day come from the placeholder, so read only year.
Keyboard and accessibility. Arrow keys move between years, and Enter or Space selects. The page buttons are named “Previous years” and “Next years”. Name the grid with calendar-label.
NwYearRangePicker
Section titled “NwYearRangePicker”NwYearRangePicker wraps Reka YearRangePickerRoot and selects a start year and an end year.
2020 | 2021 | 2022 | 2023 |
2024 | 2025 | 2026 | 2027 |
2028 | 2029 | 2030 | 2031 |
Support: … to …
<script setup lang="ts">import { shallowRef } from 'vue'import { NwYearRangePicker, NwProvider, type NwYearRangePickerProps } from '@nyxwire/vue'
const value = shallowRef<NwYearRangePickerProps['modelValue']>()</script>
<template> <NwProvider locale="en-US"> <div class="grid gap-3"> <NwYearRangePicker v-model="value" calendar-label="Support years" /> <p class="m-0 text-sm text-fg-muted" role="status"> Support: {{ value?.start?.toString() ?? '…' }} to {{ value?.end?.toString() ?? '…' }} </p> </div> </NwProvider></template>Anatomy
Section titled “Anatomy”<NwYearRangePicker> <NwYearRangePickerHeader><NwYearRangePickerPrev /><NwYearRangePickerHeading /><NwYearRangePickerNext /></NwYearRangePickerHeader> <NwYearRangePickerGrid><NwYearRangePickerGridBody><NwYearRangePickerGridRow> <NwYearRangePickerCell><NwYearRangePickerCellTrigger /></NwYearRangePickerCell> </NwYearRangePickerGridRow></NwYearRangePickerGridBody></NwYearRangePickerGrid></NwYearRangePicker>| Prop | Type | Default | Effect |
|---|---|---|---|
modelValue |
DateRange | null |
uncontrolled | Selected year endpoints |
defaultValue |
DateRange |
{ start: undefined, end: undefined } |
Initial endpoints |
yearsPerPage |
number |
12 |
Years per view |
maximumYears |
number |
unset | Range length limit |
calendarLabel |
string |
unset | Accessible name |
allowNonContiguousRanges, preventDeselect |
boolean |
false |
Unavailable-year ranges / deselection policy |
fixedDate |
'start' | 'end' |
unset | Fixed endpoint |
disabled, readonly, initialFocus |
boolean |
false |
Interaction lock / read-only / focus on mount |
The other YearRangePickerRootProps and emits pass through, including the year matchers and bounds. The model is emitted once both endpoints are set.
Keyboard and accessibility. Keep the cell triggers when you compose the grid, and name the grid with calendar-label.
States and combinations
Section titled “States and combinations”These three examples show the props from the tables together: sizes, granularity, invalid and disabled fields, unavailable dates, multiple selection and read-only grids.
Fields
Section titled “Fields”size changes the height and text size of every segmented field. granularity="second" adds a seconds segment. invalid sets aria-invalid and the danger edge, so point an error message at the field with aria-describedby. A disabled field takes its segments out of the tab order.
Value: incomplete
Value: incomplete
Enter both audit dates.
<script setup lang="ts">import { shallowRef } from 'vue'import { NwDateField, NwDateRangeField, NwLabel, NwProvider, NwTimeField, NwTimeRangeField, type NwDateFieldProps, type NwTimeFieldProps,} from '@nyxwire/vue'
const rotation = shallowRef<NwDateFieldProps['modelValue']>()const cutover = shallowRef<NwTimeFieldProps['modelValue']>()</script>
<template> <NwProvider locale="en-US"> <div class="grid w-full max-w-lg gap-5"> <div class="grid gap-2"> <NwLabel as="span">Key rotation (small)</NwLabel> <NwDateField v-model="rotation" size="sm" aria-label="Key rotation" /> <p class="m-0 text-xs text-fg-muted">Value: {{ rotation?.toString() ?? 'incomplete' }}</p> </div> <div class="grid gap-2"> <NwLabel as="span">Cutover time (large, seconds)</NwLabel> <NwTimeField v-model="cutover" size="lg" granularity="second" :hour-cycle="24" aria-label="Cutover time" /> <p class="m-0 text-xs text-fg-muted">Value: {{ cutover?.toString() ?? 'incomplete' }}</p> </div> <div class="grid gap-2"> <NwLabel as="span">Audit period (invalid)</NwLabel> <NwDateRangeField invalid aria-label="Audit period" aria-describedby="audit-error" /> <p id="audit-error" class="m-0 text-xs text-danger">Enter both audit dates.</p> </div> <div class="grid gap-2"> <NwLabel as="span">Locked shift (disabled)</NwLabel> <NwTimeRangeField disabled :hour-cycle="24" aria-label="Locked shift" /> </div> </div> </NwProvider></template>Pickers
Section titled “Pickers”is-date-unavailable takes a function that receives each DateValue. In this example it strikes weekends from the release calendar, and those days cannot be picked. number-of-months="2" shows two months side by side in the range popup. invalid marks the picker field.
Value: none
<script setup lang="ts">import { shallowRef } from 'vue'import { NwDatePicker, NwDateRangePicker, NwLabel, NwProvider, type NwDatePickerProps,} from '@nyxwire/vue'
const cutoff = shallowRef<NwDatePickerProps['modelValue']>()const weekendsOff = (date: { toDate(timeZone: string): Date }) => [0, 6].includes(date.toDate('UTC').getUTCDay())</script>
<template> <NwProvider locale="en-US"> <div class="flex flex-wrap items-start gap-8"> <div class="grid gap-2"> <NwLabel as="span">Release cutoff (weekdays only)</NwLabel> <NwDatePicker v-model="cutoff" label="Release cutoff" trigger-label="Choose release cutoff" :is-date-unavailable="weekendsOff" close-on-select /> <p class="m-0 text-xs text-fg-muted">Value: {{ cutoff?.toString() ?? 'none' }}</p> </div> <div class="grid gap-2"> <NwLabel as="span">Canary rollout (two months, small)</NwLabel> <NwDateRangePicker size="sm" label="Canary rollout" trigger-label="Choose canary rollout" :number-of-months="2" /> </div> <div class="grid gap-2"> <NwLabel as="span">Expired token (invalid)</NwLabel> <NwDatePicker invalid label="Expired token" trigger-label="Choose token expiry" /> </div> </div> </NwProvider></template>Month and year grids
Section titled “Month and year grids”multiple turns the month model into an array; clicking a selected month again removes it. is-month-unavailable blocks December here. maximum-months limits how long a range can be. years-per-page sets how many years one page shows. A readonly grid still takes focus but does not select.
Jan | Feb | Mar | Apr |
May | Jun | Jul | Aug |
Sep | Oct | Nov | Dec |
Months: none
Jan | Feb | Mar | Apr |
May | Jun | Jul | Aug |
Sep | Oct | Nov | Dec |
2020 | 2021 | 2022 | 2023 |
2024 | 2025 | 2026 | 2027 |
2028 |
Year: none
2020 | 2021 | 2022 | 2023 |
2024 | 2025 | 2026 | 2027 |
2028 | 2029 | 2030 | 2031 |
<script setup lang="ts">import { shallowRef } from 'vue'import { NwMonthPicker, NwMonthRangePicker, NwProvider, NwYearPicker, NwYearRangePicker, type NwMonthPickerProps, type NwYearPickerProps,} from '@nyxwire/vue'
const months = shallowRef<NwMonthPickerProps['modelValue']>([])const year = shallowRef<NwYearPickerProps['modelValue']>()const list = (value: NwMonthPickerProps['modelValue']) => Array.isArray(value) && value.length > 0 ? value.map((m) => `${m.year}-${String(m.month).padStart(2, '0')}`).join(', ') : 'none'</script>
<template> <NwProvider locale="en-US"> <div class="flex flex-wrap items-start gap-8"> <div class="grid gap-2"> <NwMonthPicker v-model="months" multiple :is-month-unavailable="(date) => date.month === 12" calendar-label="Patch months" /> <p class="m-0 text-xs text-fg-muted">Months: {{ list(months) }}</p> </div> <NwMonthRangePicker :maximum-months="3" calendar-label="Quarter months" /> <div class="grid gap-2"> <NwYearPicker v-model="year" :years-per-page="9" calendar-label="Fiscal year" /> <p class="m-0 text-xs text-fg-muted">Year: {{ year?.year ?? 'none' }}</p> </div> <NwYearRangePicker readonly calendar-label="Frozen contract years" /> </div> </NwProvider></template>All of these controls draw their popups in the page and portal them to <body>, so they inherit the page flavor. If an island scopes a different flavor with NwProvider, point the popup’s portalProps at an element inside that scope when you compose the parts yourself.