Skip to content

Select

The Select component provides a dropdown list that allows users to choose options from a predefined set. It supports both single selection (the default behavior) and multiple selection. It’s a standard form element for collecting user input from a list of choices.

Add the Select component to your project using the OrbitUI CLI:

Terminal window
npx orbitkit@latest add select

Import the Select and Option components. Place the Option components inside the Select component. Use standard HTML attributes on the Select component for functionality (like name, id, value, multiple) and on the Option components for their values and labels.

For single selection (default):

For multiple selection, add the multiple attribute to the Select component:

The Select component accepts all standard HTML attributes for a <select> element, plus the following props based on the selectVariants defined using class-variance-authority:

PropTypeDefault
variantdefaultdefault
disabledbooleanfalse

The Option component represents an individual selectable item within a Select dropdown. This component accepts all standard HTML attributes for an <option> element.