Components · Inputs
Select
A field that opens a list of values and shows the one chosen, for picking one of up to 10 values or a few of several.
import { Select } from "@botiverse/raft-ui";A select is a field at the control height with an ink border, like an input: 44px on a phone, 34px on a desktop. Clicking it opens a list of values; the current value has a check mark. Use it to store a value. When choosing starts an action instead, use a menu.
When to use
The full choice between pickers is in Choosing a component.
Anatomy
Select: the root. Holds the value and the open state. Required.SelectTrigger: the field that opens the list. Required. Withfitit is as wide as its longest option (As wide as its longest option).SelectValue: the chosen value in the trigger, or the placeholder.SelectIcon: the chevron at the trigger's end.SelectContent: the list's popup, positioned next to the trigger. Required.SelectList: the scrolling list of items.SelectItem: one value, withSelectItemTextandSelectItemIndicator(the check mark).SelectItemLeadingholds an icon or avatar before the text.SelectItemDescriptionis an optional second line under the text; it takes only aHelperText, made withhelperText(content, { why, about }), and renders itswhyandaboutasdata-whyanddata-about.SelectGroupandSelectGroupLabel: a group of values under a small heading.SelectSeparatoris a hairline between groups; it meets the popup's edge on both sides (Comfort), and the list never scrolls sideways for it. The list is a ScrollArea: its overlay scrollbar takes no room from the options and looks the same on every platform (a Windows scrollbar no longer narrows the list or draws arrows).SelectActionItem: an action row at the end of the list, after aSelectSeparator, such as Show all runtimes. It is not a value; see List actions.SelectLabel: a label for the select when it is not in a Field.SelectScrollUpArrow,SelectScrollDownArrow,SelectPortal,SelectPopup: lower-level parts for custom popups.
Variants
Filters
A filter is a Select or a Combobox opened from a PickerTriggerButton above a list.
- Make a filter 32px high (34px with a mouse, the control height), with a 44px hit area.
- Outline a filter that is not applied with
line-seam. Fill an applied filter withinfo-softand say what it is set to. A filter of one value says the value's name. - A filter of several values is a TagFilter: applied, the whole filter is one
info-softgroup as high as the button, the filter's name, then a 24px tag for each value with its own ×,+Nfor the tags that don't fit, and a × that clears the filter. People see which values are in effect, and take one out or clear them all, without opening the list. A count alone ("Status 2") made people open the menu to see which, and names joined into one label grew the button and couldn't be taken out one by one (Artea chose tags, 2026-12-02, #proj-raft-ui:#346). Tags fit the room by default (maxTagCount="responsive"), folding into+Nbefore the name is cut; a filter keeps its clear × (clearable).
- Put a
ghostClear all button after the filters. - When the filters don't fit beside the search, give them a line of their own that scrolls sideways, at every width (FitToolbar
overflow="scroll"; The toolbar over a list): the applied ones first (moved there once the filter's menu closes, FitToolbar) and always in view, with their labels, and Clear all, as aghost× icon button, the only thing pinned at the line's end. A filter row that wraps pushes the list down, while one that scrolls keeps every filter one swipe away (stdrc, 2026-11-10, #wg-task-v2:8a7ae237; it replaces the earlier rule that a phone's filter row fits two lines). The sort stays on the first line and drops its words before the filters do: its icon stays and fillsinfo-softwhile it differs from the default. The sort and Clear all keep their words as the accessible name ("Sort: Recently updated", "Clear filters"). The filters keep their values, since the value is what tells people which view they are in. - Open the same list as any picker: single or multiple, with search when there are many values.
Which filter button
A filter button either shows the current value or always says Filter. How often people change the filter, and why, decides which:
The Filter button and its chip:
- Make the button say Filter, with a filter icon and the chevron, whatever is chosen. It stays outlined: the chip carries the applied look, so the button never fills.
- Open a menu with one radio item per filter, the default first (DropdownMenu with radio items); a filter that is a scope rather than a read state, such as Pinned, goes after a separator. Choosing applies it at once.
- Show the chip only while the filter differs from its default. Its × resets the filter in one step, without opening the menu.
- Remember the choice on the device, per place (per server, per channel): people who set it by habit expect to find it as they left it. A filter whose value is the point of the view goes in the address instead, so the view can be shared (Tasks).
- Use it for a page with many filters, more than 3 or 4, that people mostly leave unused, or for one filter with a few values set by habit. A few filters that people do use, or many values, take buttons that show their values, so people can see every applied one at once. Polaris shows only 2 or 3 promoted filters and puts the rest behind Add filter; Stripe's More filters and Jira's More do the same (Jasper, 2026-11-10, #proj-raft-ui:f9756e85).
States
- No value:
SelectValueshows the placeholder inforeground-hint. - Invalid:
data-invalidon the trigger gives it adanger-strongborder. - The trigger is a field, so it doesn't hover; a press lays the medium tier (Hover and press).
- Disabled and the hover highlight in the list follow States.
Behavior
- Make the list as wide as the field, at least 220px. A longer option widens it up to 24rem, never past the screen less 8px on each side, and then wraps to two lines and truncates (Forms).
- The selected value in the trigger stays on one line and truncates; its whole text is the
titlewhile it is cut off. - Align a filter's list with the filter's left edge, and with its right edge when there is no room. How every popup is positioned is in Elevation.
- The list stays on the side it opens on and shrinks to the room there, scrolling, as long as that room holds five options (
--popup-list-min-height). Only with less does it flip to the other side, and it opens beside the field only when neither side holds five options (Elevation). - The list keeps clear of the frame insets: where a shell keeps part of the window for itself (
--raft-frame-inset-top,--raft-frame-inset-start,--raft-frame-inset-end), it stops 8px from that part, not from the window's edge. The start and end insets are the corners of the top band, so they count only when its trigger is in the band; under it, it keeps its own padding from the window's edge (Page structure). The web sets none. - In a phone sheet or a drawer the list always stays under the sheet's head: with little room it takes the larger side of the field and scrolls;
collisionBoundary="clipping-ancestors"opts it out (Dialog). - Open the same list on a phone. Don't replace it with a bottom sheet: a bottom sheet is for going somewhere (Choosing a component).
- With
multiple, keep the list open when a value is chosen. Clicking outside or Esc closes it. - With
multiple, put a box before each item (CheckboxIndicatorinSelectItemLeading), ink when chosen (Checkbox). The trigger shows the chosen values, or a count (3 selected) when they don't fit.
As wide as its longest option
At the end of a settings row, a select is as wide as its longest option, at least 11rem and at most 20rem (Forms › A setting's row). Give its trigger fit:
- The width comes from every label in
itemsand from the placeholder, never from the value, so it stays the same whichever value is chosen. A trigger as wide as its value would shrink to a short one, and the end of the row would jump with each choice. - Past 20rem the value ends in an ellipsis, with its whole text as the
title; the list still shows every option whole. An option that needs more usually repeats the setting: say it once in the row's description. - Pass
itemstoSelectand put aSelectValuein the trigger. The trigger lays every label out in the value's place, invisible and 0px high, so it takes its width with no script; screen readers skip those copies, they take no focus, and a text label is drawn from an attribute (::after), so the browser's find in page doesn't count it. Withoutitemsthere is nothing to measure, and afittrigger stays at its least, 11rem: if one looks too narrow, check that itsSelecthasitems. - A select in a form keeps the field's width, without
fit.
List actions
A list action changes what the list shows, never the value. Show all runtimes, at the end of a list that starts with the runtimes most people use, is one: it adds the rest to the same list.
- Put it last, after a
SelectSeparator, one per list. It isforeground-muted, so it reads as a step, not a choice, and highlights like an item, inset the same. - The arrow keys and typeahead reach it like an item. Enter, Space or a click runs
onAction; the value, the check mark andonValueChangestay as they were. - The list stays open, since the action changes what it shows. Set
closeOnActiononly when the action leaves the list, such as opening a dialog to add a runtime. - When it has shown everything, remove it, or turn it into Show fewer. Items it adds above it keep the highlight on the row, so the next arrow key goes on from there.
- An action that does something else (Manage runtimes, Add) is not part of choosing a value: put it beside the select, or use a DropdownMenu.
Content
- Group values by kind (Agents, People) with
SelectGroupLabel. - Put secondary information (a runtime, a role, presence) at the end of the item, in
foreground-hint. - Give an option a second line, in
SelectItemDescription, only when choosing it has a consequence the label doesn't say: what it costs or loses ("Uses 5× the credits of Sonnet"), who sees it, or how to recover. A line on what a value is good at ("Best for long, careful work") is cut, and so is the label repeated in another form, such as its id in lowercase: a line that says nothing new only makes the list taller (Writing › Helper text).
An item is as tall as its content, and its padding is constant (Forms): one line is 36px, and a wrapped label or a description adds only its own height, with the one-line item's space above and below the text. SelectItemDescription sits beside SelectItemText, not inside it, so the trigger shows only the label. With a SelectItemLeading, the description starts under the label, past the icon.
- Put the empty choice first when there is one, as with Unassigned (Tasks).
Accessibility
Select wraps Base UI Select: a button that opens a listbox, with typeahead and arrow-key navigation.
- Name the select with a
FieldLabel(Field), aSelectLabel, oraria-labelon the trigger. - In a multi-select, the box before each item is decorative; Base UI states the selection with
aria-selected. SelectActionItemis an option to assistive technology, as the arrow keys reach it, but it is never selected:aria-selectedstays false. It takes noaria-expanded, which ARIA does not allow on an option: its label says what it does, and the options it adds are counted in the list.SelectItemDescriptionis the option's accessible description: the item is named bySelectItemTextalone and pointsaria-describedbyat the description, so a screen reader reads the label, then the description, each once.
API
Select
SelectActionItem
Also takes the attributes of its element.
SelectArrow
Also takes the attributes of its element.
SelectContent
Also takes the attributes of its element.
SelectGroup, SelectGroupLabel, SelectIcon
Also takes the attributes of its element.
SelectItem
Also takes the attributes of its element.
SelectItemDescription
Also takes the attributes of its element.
SelectItemIndicator
Also takes the attributes of its element.
SelectItemLeading
Takes the attributes of its element.
SelectItemText, SelectLabel, SelectList
Also takes the attributes of its element.
SelectPopup
Takes the attributes of its element.
SelectPortal
Also takes the attributes of its element.
SelectScrollDownArrow, SelectScrollUpArrow
Also takes the attributes of its element.
SelectSeparator
Takes the attributes of its element.
SelectTrigger
Also takes the attributes of its element.
SelectValue
Also takes the attributes of its element.
Related
Changes
- 0.106.2 · ChangedList popups shrink and scroll on their side before flipping; the side axis is the last resort ([Elevation › Popups](https://raft-design.botiverse.build/foundations/elevation/#popups), [DropdownMenu › Long menus](https://raft-design.botiverse.build/components/dropdown-menu/#long-menus), [Popover › A long popover](https://raft-design.botiverse.build/components/popover/#a-long-popover)):
DropdownMenuContent,SelectContent,ComboboxContent, ComboboxSelect on a desktop and aPopoverContentwith aPopoverBodystay on the side they open on and shrink to the room there, scrolling their list, as long as it holds five rows (--popup-list-min-height: 178px with a mouse, 188px on a touch screen). With less they flip to the other side, and they open beside the trigger only when neither side holds five rows. - 0.103.4 · FixedFrame insets (
Popover,DropdownMenu,ContextMenu,Select,Combobox,ComboboxSelect,Tooltip,PreviewCard,CoachMark,NotificationCenter,MobileNavServerPopover,ToastPositioner,ComposerSuggestionList):--raft-frame-inset-startand--raft-frame-inset-endare the corners of the window's top band (--raft-frame-inset-top), not columns down its sides. A popup anchored under the band keeps its own padding from the window's edge; only one anchored in the band (a title-bar control, or a context menu opened in the bar) keeps 8px clear of a corner. - 0.103.3 · FixedFrame insets (
useFrameInsets,frameCollisionBoundary): opening a positioned popup (Popover,DropdownMenu,Select,Combobox,ComboboxSelect,ContextMenu,Tooltip,PreviewCard,NotificationCenter,MobileNavServerPopover,ComposerSuggestionList) no longer stalls the main thread when--raft-frame-inset-*holds acalc()orenv(titlebar-area-*)expression on an overlay title bar. - 0.103.0 · Breaking ChangesExplanation slots take only a
HelperText:FieldDescription,FormSection'sdescription, aChoiceListitem'sdescription,SelectItemDescription,DialogDescription,AlertDialogDescription,DrawerDescription,PopoverDescription,EmptyStateDescription,CardDescription,CardFooter,BannerDescription,DialogFooterNote(work in progress),MessageActionCardHint,MessageActionCardHeaderDescription,MessageActionCardScopeDescriptionandMessageActionCardActionsNote. AHelperTextis made only byhelperText(content, { why, about }):contentis anyReactNode(a string, a formatted message, aTextLinkinside a sentence),whyis"consequence","audience"or"recovery", andaboutnames the thing the line is about. Each slot renders the content withdata-whyanddata-about, and in development warns once when it is given anything else, which it still renders.ToastDescription,NotificationCenterItemBody,EmptyStateTitle,ListRowDescriptionand the status and data parts are unchanged. - 0.95.1 · Added
SelectTrigger fit: a select as wide as its longest option ([Select › As wide as its longest option](https://raft-design.botiverse.build/components/select/#as-wide-as-its-longest-option)) ([#1206](https://github.com/botiverse/raft-design/pull/1206), [#1207](https://github.com/botiverse/raft-design/pull/1207)). Withfit, the trigger is as wide as the longest label in the root'sitemsor its placeholder, at least 11rem and at most 20rem; past 20rem the value ends in an ellipsis.SelectValuelays every label out in its own place, invisible, 0px high and hidden from screen readers, so the width needs no script and stays the same whichever value is chosen. - 0.76.1 · FixedSelect and Combobox lists never scroll sideways: a Select list reaches into the popup's 4px inset and pads it back, so a
SelectSeparatormeets the popup's edge and stays inside the list, and Select and Combobox lists setoverflow-x-hidden. - 0.12.0 · Breaking Changes
ComboboxSelectalways takes typing on a phone, as on a desktop: tapping the field focuses it and typing filters;createand remote search work in the field. The phone-only pick-only mode and bottom sheet from 0.10.5 are gone, with their propssheetThreshold,sheetTitleandmessages.search/done/close. A pick-only field usesSelect. The list still picks its side once and doesn't flip while the keyboard opens. - 0.10.0 · Breaking ChangesField frames (
Input,Textarea,InputGroup,Select,Combobox,ComboboxSelect,Composer, optionCard,SearchTrigger) are drawn at 1px inline-fieldinstead of 1.5px, on the phone too.