Skip to Content

Select

A form component that provides a styled custom selection menu for picking singular values. 
For more information on this component configuration, visit Radix UI 

Disabled

Use the disabled attr or the disabled class to disable an item component.

Disabled Item

Use the disabled attr or the disabled class to disable an item component.

Valid

Use the data-valid attr or the valid class to indicate an valid state.

Invalid

Use the data-invalid attr or the invalid class to indicate an invalid state.

Sizes

Use the select-{slot}-{size} class to control the component size.

Size values can include:smmdlg.

For more information on all available sizing utilities, visit Tailwind 

Variants

Use the variant and palette classes to control the appereance of the component.

Variant values can include solidoutlinesurfacesubtleplain.
Color palettes can include primaryneutral. For extra palettes such as warning error and more, refer to the Colors section.

Customizing

globals.css
:root { --ex-select-trigger-cursor: default; --ex-select-trigger-font-family: var(--font-sans); --ex-select-trigger-font-weight: var(--font-weight-normal); --ex-select-trigger-font-size-sm: var(--text-xs); --ex-select-trigger-font-size-md: var(--text-sm); --ex-select-trigger-font-size-lg: var(--text-base); --ex-select-trigger-height-sm: calc(var(--spacing) * 9); --ex-select-trigger-height-md: calc(var(--spacing) * 10); --ex-select-trigger-height-lg: calc(var(--spacing) * 11); --ex-select-trigger-px-sm: calc(var(--spacing) * 3.5); --ex-select-trigger-px-md: calc(var(--spacing) * 4); --ex-select-trigger-px-lg: calc(var(--spacing) * 4.5); --ex-select-trigger-radius-sm: var(--radius-sm); --ex-select-trigger-radius-md: var(--radius-sm); --ex-select-trigger-radius-lg: var(--radius-sm); --ex-select-trigger-icon-size-sm: var(--text-lg); --ex-select-trigger-icon-size-md: var(--text-xl); --ex-select-trigger-icon-size-lg: var(--text-2xl); --ex-select-content-max-w-sm: var(--container-3xs); --ex-select-content-max-w-md: var(--container-2xs); --ex-select-content-max-w-lg: var(--container-xs); --ex-select-content-radius-sm: var(--radius-sm); --ex-select-content-radius-md: var(--radius-sm); --ex-select-content-radius-lg: var(--radius-sm); --ex-select-content-shadow-sm: var(--shadow-sm); --ex-select-content-shadow-md: var(--shadow-sm); --ex-select-content-shadow-lg: var(--shadow-sm); --ex-select-content-section-gap-x-sm: calc(var(--spacing) * 1.5); --ex-select-content-section-gap-x-md: calc(var(--spacing) * 2); --ex-select-content-section-gap-x-lg: calc(var(--spacing) * 2.5); --ex-select-content-section-px-sm: calc(var(--spacing) * 1.5); --ex-select-content-section-px-md: calc(var(--spacing) * 2); --ex-select-content-section-px-lg: calc(var(--spacing) * 2.5); --ex-select-content-section-py-sm: calc(var(--spacing) * 2); --ex-select-content-section-py-md: calc(var(--spacing) * 2.5); --ex-select-content-section-py-lg: calc(var(--spacing) * 3); --ex-select-content-item-font-family: var(--font-sans); --ex-select-content-item-font-weight: var(--font-weight-normal); --ex-select-content-item-font-size-sm: var(--text-sm); --ex-select-content-item-font-size-md: var(--text-sm); --ex-select-content-item-font-size-lg: var(--text-sm); --ex-select-content-item-px-sm: calc(var(--spacing) * 2); --ex-select-content-item-px-md: calc(var(--spacing) * 2); --ex-select-content-item-px-lg: calc(var(--spacing) * 2); --ex-select-content-item-py-sm: calc(var(--spacing) * 1); --ex-select-content-item-py-md: calc(var(--spacing) * 1); --ex-select-content-item-py-lg: calc(var(--spacing) * 1); --ex-select-content-item-indicator-font-size-sm: var(--text-sm); --ex-select-content-item-indicator-font-size-md: var(--text-base); --ex-select-content-item-indicator-font-size-lg: var(--text-lg); --ex-select-content-label-font-family: var(--font-sans); --ex-select-content-label-font-weight: var(--font-weight-normal); --ex-select-content-label-opacity: var(--ex-options-opacity-muted); --ex-select-content-label-font-size-sm: var(--text-2xs); --ex-select-content-label-font-size-md: var(--text-xs); --ex-select-content-label-font-size-lg: var(--text-sm); }

API

For more information on this component configuration, visit Radix UI 

Select

PropTypeDefault
defaultOpenbooleanfalse
defaultValuestringfalse
disabledbooleanfalse
namestring
openbooleanfalse
requiredbooleanfalse
valuestring
onOpenChangefunction
onValueChangefunction

Select Trigger

ElementSelector
Select.Trigger.ex-select-trigger
PropTypeDefault
asElementTypebutton
asChildbooleanfalse

Select Value

ElementSelector
Select.Value.ex-select-value
PropTypeDefault
asElementTypediv
asChildbooleanfalse
placeholderReact.Node

Select Icon

ElementSelector
Select.Icon.ex-select-icon
PropTypeDefault
asElementTypediv
asChildbooleanfalse
placeholderReact.Node

Select Portal

PropTypeDefault
containerHTMLElementdocument.body
forceMountbooleanfalse

Select Content

ElementSelector
Select.Content.ex-select-content
PropTypeDefault
asElementTypediv
asChildbooleanfalse
alignenum of ["start", "center", "end"]start
alignOffsetnumber0
arrowPaddingnumber0
avoidCollisionsbooleantrue
hideWhenDetachedbooleanfalse
positionenum of ["item-aligned", "popper"]item-aligned
sideenum of ["top", "right", "bottom", "left"]bottom
sideOffsetnumber0
stickyenum of ["always", "partial"]partial
onCloseAutoFocusfunction
onPointerDownOutsidefunction

Select Section

ElementSelector
ContextMenu.Section.ex-select-body
PropTypeDefault
asElementTypediv
asChildbooleanfalse

Select Arrow

ElementSelector
Select.Arrow.ex-select-arrow
PropTypeDefault
asChildbooleanfalse

Select Group

ElementSelector
Select.Group.ex-select-group
PropTypeDefault
asElementTypediv
asChildbooleanfalse

Select Item

ElementSelector
Select.Item.ex-select-item
PropTypeDefault
asElementTypediv
asChildbooleanfalse
disabledbooleanfalse
textValuestring
valuestring

Select Item Text

ElementSelector
Select.ItemText.ex-select-item-text
PropTypeDefault
asElementTypediv
asChildbooleanfalse

Select Item Indicator

ElementSelector
Select.ItemIndicator.ex-select-item-indicator
PropTypeDefault
asElementTypediv
asChildbooleanfalse

Select Label

ElementSelector
Select.Label.ex-select-label
PropTypeDefault
asElementTypediv
asChildbooleanfalse

Select Separator

ElementSelector
Select.Separator.ex-select-separator
PropTypeDefault
asElementTypediv
asChildbooleanfalse

Select Viewport

ElementSelector
Select.Viewport.ex-select-viewport
PropTypeDefault
asElementTypediv
asChildbooleanfalse

Select Scroll Up Button

ElementSelector
Select.ScrollUpButton.ex-select-scroll-up-button
PropTypeDefault
asElementTypediv
asChildbooleanfalse

Select Scroll Down Button

ElementSelector
Select.ScrollDownButton.ex-select-scroll-down-button
PropTypeDefault
asElementTypediv
asChildbooleanfalse
Last updated on