Calendar
Inline month grid for single-date and range selection.
Calendar is a standalone component with optional locale provider helpers.
import {
KuiCalendarComponent,
kuiProvideLocale,
type KuiCalendarValue,
type KuiDateRange,
} from '@kikita-labs/ui';Bind value with a signal and keep Date objects in component state.
SunMonTueWedThuFriSat
SunMonTueWedThuFriSat
<div class="basic-calendar-example">
<kui-calendar [(value)]="selectedDate" [minDate]="minDate" showFooter />
<kui-calendar mode="range" size="sm" [(value)]="sprintRange" locale="en-US" />
</div>The installed API covers range selection, disabled dates, locale, footer, and popover-friendly flat mode.
- Use
mode="range"when the value is aKuiDateRange. - Use
minDate,maxDate, ordisabledDatesto block days. - Use
flatinsidekui-dropdownso panel chrome is not doubled. - Use
localeorkuiProvideLocale()for month names and week start.
Inputs, models, projection slots, and locale helpers verified against @kikita-labs/ui v1.6.1 public typings.
| Name | Type | Default | Description |
|---|---|---|---|
| mode | 'single' | 'range' | 'single' | Selection mode. Range mode stores a start date and a nullable end date. |
| [(value)] | Date | KuiDateRange | null | null | Selected date in single mode or selected range in range mode. |
| [(viewDate)] | Date | current month | First-of-month date that controls the visible month. |
| size | 'md' | 'sm' | 'md' | Calendar density. Use sm when embedding in tighter sidebars or panels. |
| flat | boolean | false | Removes the calendar frame for dropdown or popover panel composition. |
| showWeekend | boolean | true | Mutes Saturday and Sunday labels when enabled. |
| showFooter | boolean | false | Shows the built-in value summary and Today shortcut. |
| minDate / maxDate | Date | undefined | undefined | Inclusive lower and upper bounds for selectable days. |
| disabledDates | Date[] | ((date: Date) => boolean) | undefined | undefined | Individual disabled dates or a predicate evaluated for each rendered date. |
| locale | string | undefined | KUI_LOCALE | BCP 47 locale override for month names, weekday names, and week start. |
| showPrevNav / showNextNav | boolean | true | Hide one header navigation control for linked multi-calendar layouts. |
| [kuiCalendarHeader] / [kuiCalendarFooter] | projected content | - | Replace the default header or footer with consumer-owned content. |
| kuiProvideLocale(locale) | Provider | - | Provides the default app or subtree locale used by date-aware components. |
| --kui-calendar-width | CSS custom property | 296px | Overrides the fixed calendar width while keeping the day grid predictable. |
Calendar owns grid semantics and roving focus; consumers provide context around the picker.
- The day grid uses
role="grid"with one focusable day at a time. - Selected days expose
aria-selected; today exposesaria-current="date". - Arrow keys, Home, End, PageUp, PageDown, Enter, and Space are handled by the grid.
- Provide nearby text or a surrounding field label when the calendar appears in a larger form.
- Assistive-technology review is still pending for the newest date primitives.