Select

Native selects with consistent spacing, focus and validation.

When to use

Use a native select when users choose from a fixed list of options in a compact control. Use Radio for a short set that should stay visible, or Input for free text.

Select

Apply .form-select to native selects.

HTML
<div>
	<label class="form-label" for="selectExample">Select label</label>
	<select class="form-select" id="selectExample" name="selectExample">
		<option value="not-specified">not specified</option>
		<option value="male">Male</option>
		<option value="female">Female</option>
	</select>
</div>

Invalid

Use aria-invalid="true" and link feedback with aria-describedby and its id.

Please select a status.

HTML
<div>
	<label class="form-label" for="invalidSelect">Invalid select</label>
	<select
		class="form-select is-invalid"
		id="invalidSelect"
		name="invalidSelect"
		aria-invalid="true"
		aria-describedby="invalidSelectFeedback">
		<option value="">Please select</option>
		<option value="active">Active</option>
		<option value="pending">Pending</option>
	</select>
	<div class="invalid-feedback" id="invalidSelectFeedback">Please select a status.</div>
</div>

Disabled

HTML
<div>
	<label class="form-label" for="disabledSelect">Disabled select</label>
	<select class="form-select" id="disabledSelect" disabled>
		<option>Disabled select</option>
	</select>
</div>

Accessibility and behavior

  • Connect a visible label with matching for and id attributes. Give submitted controls a name and each option an explicit value.
  • Keep the native keyboard and touch picker behavior. Use disabled for unavailable choices and native required with an empty-valued placeholder when selection is mandatory.
  • After validation fails, apply .is-invalid and aria-invalid, and connect feedback with aria-describedby. These styles and attributes do not perform validation.

CSS variables

Override these base defaults on the listed selector after the library styles. Variants and states may replace them; global tokens follow the active theme.

TokenDefaultPurposeScope / state
--form-select-bg-colorvar(--bg-surface)Background color..form-select
--form-select-border-widthvar(--border-width)Border thickness..form-select
--form-select-border-colorvar(--control-border-color)Border color..form-select
--form-select-border-radiusvar(--border-radius)Corner radius..form-select
--form-select-padding-yvar(--spacer-1)Top and bottom padding..form-select
--form-select-padding-xvar(--spacer-3)Left and right padding..form-select
--form-select-indicator-paddingvar(--spacer-5)Space reserved for the select arrow at the inline end..form-select
--form-select-font-sizevar(--font-size)Text size..form-select
--form-select-font-weight400Text weight..form-select
--form-select-disabled-text-colorvar(--disabled-text-color)Text color while disabled..form-select (disabled)
--form-select-disabled-bg-colorvar(--disabled-bg-color)Background color while disabled..form-select (disabled)
--form-select-disabled-border-colorvar(--disabled-border-color)Border color while disabled..form-select (disabled)
--form-select-focus-border-colorvar(--primary-hover)Border color while focused..form-select (focus)
--form-select-focus-outline-widthvar(--focus-outline-width)Focus ring thickness..form-select (focus)
--form-select-focus-outline-stylevar(--focus-outline-style)Focus ring line style..form-select (focus)
--form-select-focus-outline-colorvar(--focus-outline-color)Focus ring color..form-select (focus)
--form-select-focus-outline-offsetvar(--focus-offset)Distance between the focus ring and control..form-select (focus)
--form-select-transition-durationvar(--transition-duration)Duration of visual state transitions..form-select
--form-select-transition-easingvar(--transition-easing)Timing curve for visual state transitions..form-select