Skip to main content

Native select

The browser's own select, styled.

In Multi-brand

See it live​

Start Storybook to see it live: npm run storybook

When to use it​

In Multi-brand: A plain closed list such as country on a phone, where the system picker is best. Not where options need rich content.

  • Use it when: A plain closed list, especially on phones, where the system picker is best.
  • Not when: Options that need icons or rich content (select), or a short list better shown at once (radio group).

Instead:

  • Select: A custom menu with richer options.
  • Radio group: A short list shown at once.

Words​

  • Shared structure: object, state, next step.
  • Brand tone lives in headlines and marketing copy, not in errors.
  • Errors and confirmations read the same in every brand.
  • Use: Get started, Plan, Order. Avoid: Brand-specific words in errors, Jargon.

The labels components use, from the voice tokens:

  • content.action.commit: Save
  • content.action.cancel: Cancel
  • content.action.destroy: Remove
  • content.action.retry: Try again
  • content.action.empty-action: Get started

See Voice and tone for the whole voice.

Use it in code​

npx open-ds add native-select

The component reads only component keys and semantic tokens, so it follows the brand and mode on <html>.

Tokens it reads​

Native select reads 21 tokens of its own, each an alias of a semantic token. Each row is one part: its own token, the semantic it aliases, and the value it ends at. Change a semantic and every component that reads it follows; override one of Native select's tokens to change Native select alone.

Changes with theme

Multi-brand decides what changes when you switch theme. Here a switch changes colors, type and shape, so the marked rows differ between its brands and between light and dark; everything else holds steady.

PartIts token and the semantic it aliasesValue
Native select
Disabled opacitycomponent.native-select.disabled-opacityopacity.disabledvar(--native-select-disabled-opacity)opacity.40:0.4
Corner
Changes with theme
component.native-select.radiusradius.controlvar(--native-select-radius)Aster Lightradius.4:0.25remAster Darkradius.4:0.25remBirch Lightradius.12:0.75remBirch Darkradius.12:0.75remCoral Lightradius.999:9999pxCoral Darkradius.999:9999px
Border
Changes with theme
component.native-select.bordercolor.border.strongvar(--native-select-border)Aster Lightslate-deep.light.500:#64748BAster Darkslate-deep.dark.400:#96A3B5Birch Lightslate-deep.light.500:#64748BBirch Darkslate-deep.dark.400:#96A3B5Coral Lightslate-deep.light.500:#64748BCoral Darkslate-deep.dark.400:#96A3B5
Padding, left and rightcomponent.native-select.padding-xspace.inset.control-xvar(--native-select-padding-x)space.16:1rem
Padding, top and bottomcomponent.native-select.padding-ycomponent-spacing-map.x2var(--native-select-padding-y)space.8:0.5rem
Padding rightcomponent.native-select.padding-rightcomponent-spacing-map.x8var(--native-select-padding-right)space.48:3rem
Text sizecomponent.native-select.font-sizetype.body.font-sizevar(--native-select-font-size)font.size.16:1rem
Shadow
Changes with theme
component.native-select.shadowelevation.cardvar(--native-select-shadow)Aster Lightshadow.cardAster Darkshadow.card-darkBirch Lightshadow.cardBirch Darkshadow.card-darkCoral Lightshadow.cardCoral Darkshadow.card-dark
Fill
Changes with theme
component.native-select.backgroundcolor.action.primaryvar(--native-select-background)Aster Lightteal.light.600:#0F766EAster Darkteal.dark.600:#7FCFC6Birch Lightpurple.light.600:#6D28D9Birch Darkpurple.dark.600:#B79DF7Coral Lightorange.light.600:#C2410CCoral Darkorange.dark.600:#F7A67F
Text
Changes with theme
component.native-select.labelcolor.text.on-actionvar(--native-select-label)Aster Lightslate-deep.light.0:#FFFFFFAster Darkslate-deep.light.900:#0F172ABirch Lightslate-deep.light.0:#FFFFFFBirch Darkslate-deep.light.900:#0F172ACoral Lightslate-deep.light.0:#FFFFFFCoral Darkslate-deep.light.900:#0F172A
Label placeholder
Changes with theme
component.native-select.label-placeholdercolor.text.mutedvar(--native-select-label-placeholder)Aster Lightslate-deep.light.600:#4B5A6FAster Darkslate-deep.dark.400:#96A3B5Birch Lightslate-deep.light.600:#4B5A6FBirch Darkslate-deep.dark.400:#96A3B5Coral Lightslate-deep.light.600:#4B5A6FCoral Darkslate-deep.dark.400:#96A3B5
Heightcomponent.native-select.heightsize.control.defaultvar(--native-select-height)size.44:2.75rem
Padding y 2component.native-select.padding-y-2component-spacing-map.x1var(--native-select-padding-y-2)space.4:0.25rem
Border focus
Changes with theme
component.native-select.border-focuscolor.border.focusvar(--native-select-border-focus)Aster Lightteal.light.600:#0F766EAster Darkteal.dark.600:#7FCFC6Birch Lightpurple.light.600:#6D28D9Birch Darkpurple.dark.600:#B79DF7Coral Lightorange.light.600:#C2410CCoral Darkorange.dark.600:#F7A67F
Focus
on focus
component.native-select.focusborder-width.focusvar(--native-select-focus)border-width.2:2px
Focus ring focus
Changes with theme
on focus
component.native-select.focus-ring-focuscolor.border.focusvar(--native-select-focus-ring-focus)Aster Lightteal.light.600:#0F766EAster Darkteal.dark.600:#7FCFC6Birch Lightpurple.light.600:#6D28D9Birch Darkpurple.dark.600:#B79DF7Coral Lightorange.light.600:#C2410CCoral Darkorange.dark.600:#F7A67F
Focus ring offset focus
Changes with theme
on focus
component.native-select.focus-ring-offset-focuscolor.surface.canvasvar(--native-select-focus-ring-offset-focus)Aster Lightslate-deep.light.50:#F8FAFCAster Darkslate-deep.dark.0:#020617Birch Lightslate-deep.light.50:#F8FAFCBirch Darkslate-deep.dark.0:#020617Coral Lightslate-deep.light.50:#F8FAFCCoral Darkslate-deep.dark.0:#020617
Border invalid
Changes with theme
when invalid
component.native-select.border-invalidcolor.status.dangervar(--native-select-border-invalid)Aster Lightred.light.600:#C42B2BAster Darkred.dark.600:#F28B8BBirch Lightred.light.600:#C42B2BBirch Darkred.dark.600:#F28B8BCoral Lightred.light.600:#C42B2BCoral Darkred.dark.600:#F28B8B
Focus ring invalid
Changes with theme
when invalid
component.native-select.focus-ring-invalidcolor.status.dangervar(--native-select-focus-ring-invalid)Aster Lightred.light.600:#C42B2BAster Darkred.dark.600:#F28B8BBirch Lightred.light.600:#C42B2BBirch Darkred.dark.600:#F28B8BCoral Lightred.light.600:#C42B2BCoral Darkred.dark.600:#F28B8B
Icon sizecomponent.native-select.icon-sizesize.iconvar(--native-select-icon-size)size.16:1rem
Label 2
Changes with theme
component.native-select.label-2color.text.mutedvar(--native-select-label-2)Aster Lightslate-deep.light.600:#4B5A6FAster Darkslate-deep.dark.400:#96A3B5Birch Lightslate-deep.light.600:#4B5A6FBirch Darkslate-deep.dark.400:#96A3B5Coral Lightslate-deep.light.600:#4B5A6FCoral Darkslate-deep.dark.400:#96A3B5
From the system
Edge
Changes with theme
color.border.default
straight from the system, through --border
Aster Lightslate-deep.light.200 · #E2E8F0Aster Darkslate-deep.dark.100 · #1E293BBirch Lightslate-deep.light.200 · #E2E8F0Birch Darkslate-deep.dark.100 · #1E293BCoral Lightslate-deep.light.200 · #E2E8F0Coral Darkslate-deep.dark.100 · #1E293B