Tonic UI
Getting StartedColor ModeColor StyleVersionsContributing
THEME
BordersBreakpointsColorsOutlinesPositionsSpacingSizesShadowsTypography
BUILDING BLOCKS
BoxControlBox
UTILITIES

Select

The Select component is used for collecting user provided information from a list of options.

Import

Usage

EDITABLE EXAMPLE

Variants

The Select component comes in 3 variants: outline, filled, and unstyled. Pass the variant prop and set it to either of these values.

outline

EDITABLE EXAMPLE

filled

EDITABLE EXAMPLE

unstyled

EDITABLE EXAMPLE

Attributes

The <select> element has some unique attributes you can use to control it, such as multiple to specify whether multiple options can be selected, and size to specify how many options should be shown at once. It also accepts most of the general form input attributes such as disabled, required, etc.

Multiple options

EDITABLE EXAMPLE

disabled

EDITABLE EXAMPLE

required

EDITABLE EXAMPLE

Props

Select

NameTypeDefaultDescription
variantstring'outline'The variant of the select style to use. One of: 'outline', 'filled', 'unstyled'
disabledbooleanIf true, the user cannot interact with the control. This sets aria-disabled=true and you can style this state by passing the _disabled prop.
isInvalidbooleanIf true, the input will indicate an error. You can style this state by passing the _invalid prop.

Option / OptionGroup