Select
A field to pick one option, or several, from a list, with Input Field's label and states, and search when the list is long. Use it for 5 or more options; for fewer, radio buttons or checkboxes.
Ritla scan of this preview: 41 of 41 checks3 breakpointsScanned
Preview
Mirrored is the same English content laid out right to left: it separates a mirroring bug from a translation one.
Installation
Add the component
npx ritla add selectAlso works with shadcn:
npx shadcn@latest add @ritla/selectDependencies it brings
@base-ui/react@phosphor-icons/reactOr copy by hand
Installing by hand copies the component's source into your project. The source comes with a Ritla UI license, so the CLI is the short way to the same files.
Usage
import { Select } from "@/components/ui/select";<Select label="Transfer purpose" options={[{ value: "rent", label: "Rent" }, …]} onValueChange={setPurpose} />Examples
States
A short list (5 options) opens without search. Don't preselect an option unless it's a safe default.
Icon and description
icon and description per option, and disabled for one that isn't available. The chosen row shows a check.
Multi select
MultiSelect: chosen options are tags in the field, each with a remove button; typing in the field filters the list; rows carry a checkbox and the list stays open until Done.
Multi select states
Past maxTags tags the field sums up the rest (“+2 more”) until it's focused; error and disabled as on Input Field; onCreate adds “Create new” with what the person typed.
API reference
Select
| Prop | Type | Default | Description |
|---|---|---|---|
label | ReactNode | None | Figma's Show label. |
options | { value, label, description?, icon?, disabled? }[] | None | The options. |
value / defaultValue | string | null | None | The chosen option's value. |
onValueChange | (value: string | null) => void | None | When an option is picked. |
searchable | boolean | options ≥ 8 | The search box at the top of the list. |
placeholder / searchPlaceholder / emptyText | string | None | Default: in the page language (“Choose an option”, “Search”, “No matches”). |
name | string | None | Form field name. |
required / helperText / error / disabled | … | None | As on Input Field. |
MultiSelect
| Prop | Type | Default | Description |
|---|---|---|---|
options | { value, label, description?, icon?, disabled? }[] | None | The options, as on Select. |
value / defaultValue | string[] | None | The chosen options' values. |
onValueChange | (value: string[]) => void | None | When options are picked or removed. |
maxTags | number | 3 | Tags shown while the field isn't focused; the rest become “+N more”. |
onCreate | (query: string) => void | None | Adds a “Create new” button to the list footer. |
placeholder / emptyText / name | string | None | As on Select (“Choose options”). |
label / required / helperText / error / disabled | … | None | As on Input Field. |
Usage guidelines
A select picks a value from more options than fit on screen at once. When to pick it, what the default is, how to order the options, and the checks before handoff.
1. Select, or something else
A select is right when there are too many options to show at once, and people know what they are looking for. With a few options, show them all: people compare better when they can see every choice.
| Choice | Use | Why |
|---|---|---|
| One of 2 to 4 options in a form | Radio group | Every option is visible and one press away. |
| One of 5 or more options | Select, Single | A compact field; search turns on from 8 options. |
| Several of a few options | Checkbox group | All options visible, each on or off. |
| Several of many options | Select, Multi | Chosen options show as tags with “+N more”. |
| Switching a view or filter on the page | Toggle group | Applies at once, without opening a list. |
| A country for a phone number | Phone number field | The country selector is built in. |
| An action (Edit, Delete, Export) | Menu button | A select chooses a value; a menu runs actions. |
Show short lists
Choosing a country, and choosing a delivery speed.
2. Placeholder and defaults
Before anything is chosen, the field shows a placeholder such as “Choose an option” (code writes it in the page language). Preselect an option only when it is a safe default most people keep, such as the currency of the store. Never preselect a choice people must think about.
Don't guess personal details
The city in a delivery address.
Do
- Leave the field empty with a placeholder when there is no safe default.
- Preselect a safe default: the store's currency, today's month, the language of the page.
- Say “Choose a city”, naming what to choose, when the label alone is vague.
Don't
- Preselect personal details: city, gender, nationality.
- Put an “Other” or “None” option first to fill the field.
- Use the placeholder as the only label.
3. The list of options
Order options the way people look for them: alphabetically for long lists like countries, by frequency or natural order for short ones (sizes, months). Keep labels short and distinct; add a description line only when two options would otherwise look alike. Group long lists with section headers.
Do
- Sort long lists alphabetically in the page language.
- Keep a natural order where one exists: S, M, L; January to December.
- Turn on search for long lists; code does it from 8 options.
- Say what to do when search finds nothing (“No matches”).
Don't
- Sort by an internal ID or database order.
- Mix languages in one list.
- Put more than one line of text in every option.
4. Multi select
Multi shows the chosen options as tags in the field; past a few, the rest collapse into “+N more”. The list stays open while people pick, and Done closes it. Create new adds the typed text as an option when the list allows it.
Do
- Use Multi when people pick several from a long list, such as skills or cities.
- Let people remove a tag from the field without opening the list.
- Offer Create new only where new options make sense, like tags.
Don't
- Use Multi for two or three options; use checkboxes.
- Close the list after every pick.
- Hide what is chosen behind a count alone.
5. Arabic
Use the RTL variant: the caret sits at the inline end (the left) and the list opens in the page's direction and language. Write option labels in Arabic and sort them with Arabic collation (Intl.Collator("ar")), which a byte sort gets wrong. Country and city names come from a localized source, not a transliteration.
Arabic form, Arabic options
The country field in an Arabic checkout.
Before handoff
- A select only for 5 or more options; fewer are radios or a toggle group.
- No personal detail is preselected.
- The option order and the search threshold are decided.
- Arabic forms use the RTL variant with Arabic, correctly sorted options.
Accessibility
Keyboard
Keys are written for left-to-right. In right-to-left the arrow keys swap: the one pointing toward the reading direction moves forward.
| Key | Action |
|---|---|
| EnterSpaceArrowDown | Opens the list. |
| ArrowUpArrowDown | Between options; Enter picks, Escape closes. |
| A–Z | In a short list: jumps to the option starting with the letter. In a long one: types into the search. |
| Backspace | Multi select, with nothing typed: removes the last tag. |
ARIA
- The field is a button tied to the label that opens a
listbox; the chosen option isaria-selectedand shows a visible check. - Helper text and errors are linked as on Input Field.
- Multi select: the field is
role="combobox", each row is one option witharia-selected(the checkbox is drawn, not a second control), the number chosen is announced (“3 selected”), and each tag has a “Remove” button with its name.
Do
- A visible label on every select.
- Arrows move, Enter picks, Escape closes, and typing jumps to matches.
- In Multi, each tag has a named remove button, and Backspace removes the last.
Don't
- A select built from a
divthat only opens on click. - The caret as the only cue that the field opens a list.
Arabic and RTL notes
Mirrors
- The caret sits at the end of the field (the left), and the row icon and check swap sides.
- The list carries the page direction and language, even when opened from an LTR island.
Does not mirror
- The caret points down in both directions; the check doesn't mirror.
- Numerals
- Numbers in options are as you write them; use
formatNumberfor amounts. - Arabic typography
- The field is
label-16; rowslabel-14Medium withlabel-12descriptions. Search matches Arabic the way people type it: hamza forms match ا, ة matches ه, ى matches ي, and diacritics are ignored, so «اسامه» finds «أسامة». - Mixed-direction text
- Each option and description takes
dir="auto": an English name in an Arabic list runs left to right.
Do
- The RTL variant in Arabic forms.
- Sort with Arabic collation (
Intl.Collator("ar")). - Standard Arabic country and city names: «الأردن», not «جوردان».
Don't
- English option labels in an Arabic form.
- Transliterate names instead of translating them.
Checks it passes
The Ritla checks this component satisfies by construction. Used as documented, it does not bring these defects onto your page.