Skip to content
Dalvan UI

Native Select

Style native single-choice dropdowns and multiple-choice lists.

Playground

<label class="dv-grid dv-gap-50">
  Team
  <select name="team" class="dv-native-select">
    <option value="design">Design</option>
    <option value="engineering">Engineering</option>
    <option value="support">Support</option>
  </select>
</label>

Usage

After setting up the CSS, apply dv-native-select to a labeled select. Use option values for the data submitted by the form.

<label for="select-team">Team</label>
<select id="select-team" name="team" class="dv-native-select">
  <option value="design">Design</option>
  <option value="engineering">Engineering</option>
  <option value="support">Support</option>
</select>

Examples

Use a size class to set the control density. The styled dropdown appears in browsers with customizable select support. The control remains native.

<label>Team
  <select name="team" class="dv-native-select dv-native-select--sm">
  <option value="design">Design</option>
  <option value="engineering">Engineering</option>
  <option value="support">Support</option>
  </select>
</label>
<label>Archived team
  <select class="dv-native-select dv-native-select--lg" disabled>
    <option>Operations</option>
  </select>
</label>

Multiple selection

Use multiple for a native multi-select list and a numeric size attribute to set the visible row count. The attribute and the visual size modifier can be used together.

<label>Teams
  <select name="teams" class="dv-native-select" multiple size="3">
  <option value="design">Design</option>
  <option value="engineering">Engineering</option>
  <option value="support">Support</option>
  </select>
</label>

API reference

Class or attributeBehavior
dv-native-selectStyles the native select and enables the styled picker where supported.
dv-native-select--smdv-native-select--mddv-native-select--lgChanges control typography and padding. Medium is the default.
multiplesizeNative list behavior and visible row count.
selecteddisabledUse selected on an option to set its initial selection. Disable the whole control or individual options as needed.

Customization

Set control tokens on the select. In browsers with the styled picker, option padding uses the same spacing tokens.

PropertyEffect and defaults
--dv-native-select-padding-block / --dv-native-select-padding-inlinePadding set by the selected size.
--dv-native-select-backgroundSurface color computed from the surrounding appearance.
--dv-radius-md / --dv-color-focusShared corner radius and keyboard focus color.