Datepicker

A datepicker component.

Installation

npx wdc add datepicker

Examples

Basic Usage

Simple date picker with default formatting.

Custom Format

Use any Angular DatePipe format (e.g., 'fullDate', 'dd/MM/yyyy').

Validation States

Consistent error and success styling.

Date is required.

API Reference

InputTypeDefaultDescription
formatstring'mediumDate'Format string for the displayed date (Angular DatePipe format).
labelstring''Label displayed above the date picker.
placeholderstring'Pick a date'Text displayed when no date is selected.
errorstring | nullnullError message (Changes border to red).
successbooleanfalseSuccess state (Changes border to green).
check_circle
SEO & Accessibility
  • Keyboard Nav: The calendar supports simple click interaction. For full accessibility, the trigger button has aria-expanded attributes.
  • Semantic: The calendar grid doesn't strictly follow the complex WAI-ARIA <grid> pattern for keyboard arrows (left/right/up/down) in this lightweight version, but the buttons are tab-accessible.
  • SEO: The Label and Input association is maintained via the wrapper logic.