Date Picker
A read-only date field that opens a month calendar, for picking one date.
<arc-date-picker>Overview
DatePicker is a read-only text field that opens a calendar. Clicking the field toggles a six-week grid for one month, with buttons for the previous and next month. Clicking the month title switches to a grid of months, and again to a grid of years, for longer jumps. The field shows the chosen date as "Jan 15, 2026", and value holds it as YYYY-MM-DD. Picking a date fires arc-change with that string.
min and max take ISO dates. Days outside the range are dimmed and can't be picked. Today has an inset ring and the selected day a filled accent circle. Month and weekday names follow locale, which defaults to the page's lang, and the week starts on the locale's usual first day unless you set first-day-of-week (1 is Monday, 7 is Sunday).
Escape closes the calendar and puts focus back in the field, and a click outside closes it too. The calendar renders in the top layer, so an overflow: hidden ancestor doesn't clip it. For a start and end date, use DateRangePicker.
Guidelines
Do
- Set `min` and `max` when only some dates make sense, such as future-only booking dates
- Set a `label`, such as "Start date" or "Date of birth". Without one, the field is named "Choose date"
- Send the ISO `value` to forms and APIs, not the displayed text
- Set `value` when editing an existing record, so the calendar opens on the right month
Don't
- Don't set `min` later than `max`. Every date is disabled
Features
- The day grid is one tab stop. Arrow keys move by a day or a week, and Home and End go to the start and end of the week
- Form-associated: with a `name`, the ISO value submits with the form
- Set `open` to open the calendar from code. It stays closed while `disabled`
Preview
Usage
This component needs JavaScript. Use the Web Component or a framework wrapper.
<arc-date-picker label="Select Date" placeholder="Choose a date"></arc-date-picker>import { DatePicker } from '@arclux/arc-ui-react';
export default function Example() {
return (
<DatePicker label="Select Date" placeholder="Choose a date" />
);
}<script setup>
import { DatePicker } from '@arclux/arc-ui-vue';
</script>
<template>
<DatePicker label="Select Date" placeholder="Choose a date" />
</template><script>
import { DatePicker } from '@arclux/arc-ui-svelte';
</script>
<DatePicker label="Select Date" placeholder="Choose a date" />import { Component } from '@angular/core';
import { DatePicker } from '@arclux/arc-ui-angular';
@Component({
imports: [DatePicker],
template: `
<arc-date-picker label="Select Date" placeholder="Choose a date"></arc-date-picker>
`,
})
export class MyComponent {}import { DatePicker } from '@arclux/arc-ui-solid';
export default function Example() {
return (
<DatePicker label="Select Date" placeholder="Choose a date" />
);
}import { DatePicker } from '@arclux/arc-ui-preact';
export default function Example() {
return (
<DatePicker label="Select Date" placeholder="Choose a date" />
);
}API
valuestring''- The selected date as an ISO string (YYYY-MM-DD). Set this to pre-select a date. Updated when the user picks a date from the calendar.
namestring''minstring''- Minimum selectable date as an ISO string. Dates before this are visually dimmed and non-interactive.
maxstring''- Maximum selectable date as an ISO string. Dates after this are visually dimmed and non-interactive.
placeholderstring'Select date'- Placeholder text displayed in the input when no date is selected.
disabledbooleanfalse- Disables the date picker, reducing opacity and preventing the calendar from opening.
labelstring''- Label text rendered above the input in uppercase accent font styling.
localestring''- BCP 47 tag used for month and weekday names. Defaults to the document's
lang, then the browser's language. first-day-of-weeknumber0- Which day the week starts on, 1 = Monday … 7 = Sunday. Defaults to the locale's own convention, so most of the world gets Monday and the US gets Sunday without configuring anything.
openbooleanfalse- Whether the calendar dropdown is visible. Reflected so it can be opened programmatically or styled from CSS. Held at
falsewhiledisabled. size'sm' | 'md' | 'lg''md'- Control size.
mdis the default;smandlgscale the field padding. formAssociatedbooleantruepropertiesobject{ // flag(), unlike `disabled`. The exclusion in props.js is specifically // about form-associated *platform* semantics: a `disabled` content // attribute that is merely present makes the element actually disabled // per the HTML spec, and formDisabledCallback assigns the property back, // so no converter can win. Neither of these is platform-mapped: // `required` is enforced by _computeValidity() below and `readonly` by // each component's own interaction handlers, so the stock converter buys // nothing here and costs the usual bug: `required="false"` read as true, // blocking submission of a form the author meant to leave optional. // Finding #48's shape, across all 26 form controls at once. required: flag(false), readonly: flag(false), }- Lit merges static properties up the prototype chain, so every consumer
gets these without declaring them.
requiredparticipates in constraint validation below;readonlyreflects for styling and is enforced by each component's interaction handlers (the mixin can't know which gestures mutate state). autoValidatesbooleantrue- Components that run their own constraint-validation logic (pattern checks, range checks) opt out of the automatic required sync by overriding this to false, and own the whole validity flag set instead.
formvalidityvalidationMessagerequiredbooleanfalsereadonlybooleanfalse
Methods
checkValidity()boolean- Whether the control currently satisfies its constraints, per the native
constraint-validation API. Fires
invalidon the element when it does not, and reports nothing to the user. reportValidity()boolean- As checkValidity(), but also shows the browser's validation message against the control when it fails.
Events
arc-changedetail:{ value: string }- Fired when a date is selected