Skip to content

Search

Start typing to search.


Show all pages

Documentation

controls

Date range

Two native date fields for a period, such as a holiday or a report.

Native behaviorUses built-in HTML behavior, so you write no script.

Usage

A fieldset with a start and an end field, marked with data-ca-range. The end cannot be before the start.

Holiday, no lessons
HTML

Examples

With a hint

Connect a hint to the whole range with aria-describedby on the fieldset.

Report period

Up to one year. The end moves along when you pick a later start.

HTML

Guidance and accessibility

When to use

  • Use a date range for a period with a start and an end, such as a holiday or the dates of a report.
  • For one date, use a single date input.

Accessibility

  • Both fields are native date inputs with their own visible label, so phones show their pickers and screen readers read “From” and “Until”.
  • The <legend> names the period and is read with each field.
  • ca-date-range.js sets min on the end and max on the start, so pickers only offer valid dates; a start after the end moves the end along.
  • Check the range on the server too.

Classes

Generated from the component contract. Parts use __, modifiers use --.

Classes of the date-range component
ClassKindUse it for
ca-date-rangeComponentThe <fieldset> around the two fields.
ca-date-range__fieldsPartThe row with both fields; it stacks when narrow.
ca-date-range__fieldPartA <label> with its date input.
ca-date-range__separatorPartThe dash between the fields; decoration.

Skins

The same markup, dressed by each skin. Structure and behavior stay the same; only the look changes.

Base skin

Neutral grayscale starting point; product skins extend it and change what differs.

Holiday, no lessons

Calaca skin

The Calaca UI brand: hueso paper and tinta ink, cempasúchil marigold, rosa and jade.

Holiday, no lessons

Proof skin

Pilot skin pushed far from base: square, heavy, offset shadows, larger targets.

Holiday, no lessons

Crossview skin

The CrossView proofing table: cool ground, bond-paper sheets, rule-grey hairlines, one red mark.

Holiday, no lessons

Framework notes

Link the prebuilt stylesheet of your skin next to your brand theme. No build step.

HTML
<link rel="stylesheet" href="theme.css" />
<link rel="stylesheet" href="ca-base.css" />