- Implementation
- DateFieldYearlessRange Props
Common Examples
Controlled vs Uncontrolled
TheDateFieldYearlessRange component can be used in controlled or uncontrolled mode.Uncontrolled
UsedefaultValue to set an initial value without controlling the state.Controlled
Usevalue and onChange for full control over the component state.Date Format Modes
The component supports two date format modes:mm/dd (default) and dd/mm.With Validation
Show error states when validation fails.Sizes
The component supportssmall, medium, and large sizes.Custom Labels
Customize the accessible labels for the start and end date fields.React Accessibility
- The component uses a
fieldsetwith alegendfor proper grouping - Start and end date fields have individual accessible labels (visually hidden)
- Error messages are announced via
aria-live - The
moreInfotooltip content is also available to screen readers
Markdown in labels
Thelabel prop supports inline markdown: bold (**text**), italic (*text*), bold and italic (***text***), highlight (==text==), and code (`text`).Hide the label
UsehideLabel to visually hide the label. The label string is kept as a screen-reader-only <legend> element so the group remains accessible — any inline markdown is stripped to plain text.