Skip to content

Select

Get Ritla UI

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

Open in Figma

Preview

Mirrored is the same English content laid out right to left: it separates a mirroring bug from a translation one.

PreviewCode
EnglishMirroredArabic
LTR →

Installation

  1. Add the component

    npx ritla add select

    Also works with shadcn: npx shadcn@latest add @ritla/select

  2. Dependencies it brings

    @base-ui/react@phosphor-icons/react

  3. Or 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

select.tsx
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.

EnglishMirroredArabic
LTR →

Icon and description

icon and description per option, and disabled for one that isn't available. The chosen row shows a check.

EnglishMirroredArabic
LTR →

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.

EnglishMirroredArabic
LTR →

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.

EnglishMirroredArabic
LTR →

API reference

Select

PropTypeDefaultDescription
labelReactNodeNoneFigma's Show label.
options{ value, label, description?, icon?, disabled? }[]NoneThe options.
value / defaultValuestring | nullNoneThe chosen option's value.
onValueChange(value: string | null) => voidNoneWhen an option is picked.
searchablebooleanoptions ≥ 8The search box at the top of the list.
placeholder / searchPlaceholder / emptyTextstringNoneDefault: in the page language (“Choose an option”, “Search”, “No matches”).
namestringNoneForm field name.
required / helperText / error / disabled…NoneAs on Input Field.

MultiSelect

PropTypeDefaultDescription
options{ value, label, description?, icon?, disabled? }[]NoneThe options, as on Select.
value / defaultValuestring[]NoneThe chosen options' values.
onValueChange(value: string[]) => voidNoneWhen options are picked or removed.
maxTagsnumber3Tags shown while the field isn't focused; the rest become “+N more”.
onCreate(query: string) => voidNoneAdds a “Create new” button to the list footer.
placeholder / emptyText / namestringNoneAs on Select (“Choose options”).
label / required / helperText / error / disabled…NoneAs 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.

ChoiceUseWhy
One of 2 to 4 options in a formRadio groupEvery option is visible and one press away.
One of 5 or more optionsSelect, SingleA compact field; search turns on from 8 options.
Several of a few optionsCheckbox groupAll options visible, each on or off.
Several of many optionsSelect, MultiChosen options show as tags with “+N more”.
Switching a view or filter on the pageToggle groupApplies at once, without opening a list.
A country for a phone numberPhone number fieldThe country selector is built in.
An action (Edit, Delete, Export)Menu buttonA select chooses a value; a menu runs actions.

Show short lists

Choosing a country, and choosing a delivery speed.

Do: Select for a long list200 countries don't fit on screen; a searchable select does.
Don't: Select for two optionsExpress is hidden behind a press, and people can't compare prices at a glance.

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: Empty, with a placeholderPeople have to choose, so the city is theirs.
Don't: Preselected cityPeople skip the field and ship to Amman by mistake.

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.

Do: RTL variantThe label, value and caret follow the Arabic layout.
Don't: English variant with an Arabic valueThe caret sits on the right and the text keeps Latin fonts.

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.

KeyAction
EnterSpaceArrowDownOpens the list.
ArrowUpArrowDownBetween options; Enter picks, Escape closes.
A–ZIn a short list: jumps to the option starting with the letter. In a long one: types into the search.
BackspaceMulti 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 is aria-selected and 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 with aria-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 div that 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 formatNumber for amounts.
Arabic typography
The field is label-16; rows label-14 Medium with label-12 descriptions. 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.

  • R050Arabic text falling back past the declared font family (measured, declared, or a webfont that failed to load)
  • R051letter-spacing applied to Arabic text (breaks the connected script)
  • R023Text inputs rendered LTR where Arabic input is expected