Skip to content

Search

Start typing to search.


Show all pages

Documentation

controls

Select

A native list of options to pick one value from, such as a length or a car.

CSS onlyPlain classes; no JavaScript in any stack.

Usage

A select needs the component class and one size, inside a field with a label.

HTML

Examples

Sizes

Sizes match the input and button sizes, so they line up in a row.

HTML

With an error

Mark the select with aria-invalid="true" and point aria-describedby at the error message.

Choose the car for this lesson.

HTML

Guidance and accessibility

When to use

  • Use a select to pick one value from a list of about five to fifteen options.
  • With two to four options, radio buttons show every choice at once.
  • With many options people know by name, such as countries, a text input with suggestions is faster.

Accessibility

  • It is a native <select>: the browser’s own list opens on phones and with the keyboard, and screen readers announce the options.
  • Give it a visible <label>, connected with for and id.
  • An empty first option such as “Choose a car” works as a prompt; pair it with an error when nothing is chosen.
  • In browsers that support a customizable select (appearance: base-select, in Chrome and Safari), the open menu wears the skin too: the same edge, radius and colors as the field. Other browsers show their native menu. The markup stays a plain <select> either way.
  • In forced colors the skin’s arrow gives way to the browser’s own.

Classes

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

Classes of the select component
ClassKindUse it for
ca-selectComponentFull-width native select with the skin's arrow and the focus ring.
ca-select--smSizeCompact size for toolbars and tables.
ca-select--mdSizeDefault size.
ca-select--lgSizeProminent size for search and sign-up forms.

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.

Calaca skin

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

Proof skin

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

Crossview skin

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

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" />