Skip to main content

Select

One choice from a list, in a menu.

In Multi-brand

See it live​

Start Storybook to see it live: npm run storybook

When to use it​

In Multi-brand: Country and plan options.

  • Use it when: Four or more options, a known closed list, or a setting with a default.
  • Not when: Two to five options people should see (radio group), or many flags (checkboxes).

Instead:

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.

Accessibility and keyboard​

KeyboardWhat happensNot
undefinedArrows move; Enter picks; Escape closes.undefined

Test before you ship:

  • It has a visible label; the chosen value is announced. undefined

Use it in code​

npx open-ds add select

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

Tokens it reads​

Select reads 30 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 Select's tokens to change 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
Shared
Input background
Changes with theme
component.input.backgroundcolor.surface.defaultvar(--input-background)Aster Lightslate-deep.light.0:#FFFFFFAster Darkslate-deep.dark.50:#0F172ABirch Lightslate-deep.light.0:#FFFFFFBirch Darkslate-deep.dark.50:#0F172ACoral Lightslate-deep.light.0:#FFFFFFCoral Darkslate-deep.dark.50:#0F172A
Input border @
Changes with theme
component.input.bordercolor.border.strongvar(--input-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
Input border focus
Changes with theme
on focus
component.input.border.focuscolor.border.focusvar(--input-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
Input text
Changes with theme
component.input.textcolor.text.primaryvar(--input-text)Aster Lightslate-deep.light.900:#0F172AAster Darkslate-deep.dark.900:#F8FAFCBirch Lightslate-deep.light.900:#0F172ABirch Darkslate-deep.dark.900:#F8FAFCCoral Lightslate-deep.light.900:#0F172ACoral Darkslate-deep.dark.900:#F8FAFC
Input placeholder
Changes with theme
component.input.placeholdercolor.text.mutedvar(--input-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
Input heightcomponent.input.heightsize.control.defaultvar(--input-height)size.44:2.75rem
Input padding xcomponent.input.padding-xspace.inset.control-xvar(--input-padding-x)space.16:1rem
Input radius
Changes with theme
component.input.radiusradius.controlvar(--input-radius)Aster Lightradius.4:0.25remAster Darkradius.4:0.25remBirch Lightradius.12:0.75remBirch Darkradius.12:0.75remCoral Lightradius.999:9999pxCoral Darkradius.999:9999px
Input font sizecomponent.input.font-sizetype.body.font-sizevar(--input-font-size)font.size.16:1rem
Overlay background
Changes with theme
component.overlay.backgroundcolor.surface.raisedvar(--overlay-background)Aster Lightslate-deep.light.0:#FFFFFFAster Darkslate-deep.dark.100:#1E293BBirch Lightslate-deep.light.0:#FFFFFFBirch Darkslate-deep.dark.100:#1E293BCoral Lightslate-deep.light.0:#FFFFFFCoral Darkslate-deep.dark.100:#1E293B
Overlay radius
Changes with theme
component.overlay.radiusradius.containervar(--overlay-radius)Aster Lightradius.8:0.5remAster Darkradius.8:0.5remBirch Lightradius.16:1remBirch Darkradius.16:1remCoral Lightradius.20:1.25remCoral Darkradius.20:1.25rem
Overlay shadow
Changes with theme
component.overlay.shadowelevation.overlayvar(--overlay-shadow)Aster Lightshadow.overlay:0px 12px 32px 0px #0F172A29Aster Darkshadow.overlay-dark:0px 12px 32px 0px #00000080Birch Lightshadow.overlay:0px 12px 32px 0px #0F172A29Birch Darkshadow.overlay-dark:0px 12px 32px 0px #00000080Coral Lightshadow.overlay:0px 12px 32px 0px #0F172A29Coral Darkshadow.overlay-dark:0px 12px 32px 0px #00000080
Overlay item heightcomponent.overlay.item-heightsize.control.defaultvar(--overlay-item-height)size.44:2.75rem
Trigger
Gapcomponent.select.trigger.gapspace.gap.defaultvar(--select-trigger-gap)space.12:0.75rem
Font family
Changes with theme
component.select.trigger.font-familytype.body.font-familyvar(--select-trigger-font-family)Aster Lightfont.family.inter:Inter, system-ui, sans-serifAster Darkfont.family.inter:Inter, system-ui, sans-serifBirch Lightfont.family.plus-jakarta-sans:"Plus Jakarta Sans", system-ui, sans-serifBirch Darkfont.family.plus-jakarta-sans:"Plus Jakarta Sans", system-ui, sans-serifCoral Lightfont.family.poppins:Poppins, system-ui, sans-serifCoral Darkfont.family.poppins:Poppins, system-ui, sans-serif
Border widthcomponent.select.trigger.border-widthborder-width.defaultvar(--select-trigger-border-width)border-width.1:1px
Select
Focus
on focus
component.select.focusborder-width.focusvar(--select-focus)border-width.2:2px
Canvas
Changes with theme
on focus
component.select.canvascolor.surface.canvasvar(--select-canvas)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
Sizecomponent.select.sizesize.iconvar(--select-size)size.16:1rem
Content
Paddingcomponent.select.content.paddingcomponent-spacing-map.x1var(--select-content-padding)space.4:0.25rem
Text
Changes with theme
component.select.content.labelcolor.text.primaryvar(--select-content-label)Aster Lightslate-deep.light.900:#0F172AAster Darkslate-deep.dark.900:#F8FAFCBirch Lightslate-deep.light.900:#0F172ABirch Darkslate-deep.dark.900:#F8FAFCCoral Lightslate-deep.light.900:#0F172ACoral Darkslate-deep.dark.900:#F8FAFC
Border widthcomponent.select.content.border-widthborder-width.defaultvar(--select-content-border-width)border-width.1:1px
Border
Changes with theme
component.select.content.bordercolor.border.defaultvar(--select-content-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
Item
Gapcomponent.select.item.gapspace.gap.defaultvar(--select-item-gap)space.12:0.75rem
Padding leftcomponent.select.item.padding-leftspace.inset.cell-xvar(--select-item-padding-left)space.16:1rem
Padding rightcomponent.select.item.padding-rightcomponent-spacing-map.x8var(--select-item-padding-right)space.48:3rem
Corner
Changes with theme
component.select.item.radiusradius.badgevar(--select-item-radius)Aster Lightradius.4:0.25remAster Darkradius.4:0.25remBirch Lightradius.999:9999pxBirch Darkradius.999:9999pxCoral Lightradius.999:9999pxCoral Darkradius.999:9999px
Text sizecomponent.select.item.font-sizetype.body.font-sizevar(--select-item-font-size)font.size.16:1rem
Sunken
Changes with theme
on focus
component.select.item.sunkencolor.surface.sunkenvar(--select-item-sunken)Aster Lightslate-deep.light.100:#F1F5F9Aster Darkslate-deep.dark.100:#1E293BBirch Lightslate-deep.light.100:#F1F5F9Birch Darkslate-deep.dark.100:#1E293BCoral Lightslate-deep.light.100:#F1F5F9Coral Darkslate-deep.dark.100:#1E293B
Disabled
when disabled
component.select.item.disabledopacity.disabledvar(--select-item-disabled)opacity.40:0.4