Ask Rift AI
Theme: Smoke
Layout: Contained
Background: Field
Search or ask anythingAsk Rift AI
Theme: Smoke
Layout: Contained
Background: Field
Colour mode: System

Inspector dropdown

A pick from a list in one row

The name sits on the left and the chosen option and a chevron on the right. It is the library Dropdown with its trigger dressed as an inspector bar, so the menu, its keyboard model and its per-option font previews are Dropdown’s own. A click anywhere on the bar, the name included, opens the menu.

Sizes

The size prop matches Button’s: default is 40px tall and compact is 32px.

Default
Compact

Font previews

Give an option a font and its row renders in that face, as in Dropdown. The selected option’s face carries into the bar, so a typeface picker previews the current choice where it sits.

Placeholder

With no value set, the bar shows the placeholder on the right.

Disabled

Default
Compact

When to use it

Use the inspector dropdown for a pick from a short list in a dense panel, usually inside an inspector section, whose open body lets the menu open past its edge. For a form field with a label above and helper text below, use Dropdown itself.

Props

Read from the same JSDoc that ships in the package's types. A required prop is marked with an asterisk.

InspectorDropdown props
PropTypeDefaultDescription
label*
string
The setting's name, drawn inside the bar on the left. Also the dropdown's accessible name.
value
string
Currently selected value, controlled. Leave undefined to let the dropdown keep its own selection, seeded from `defaultValue`.
defaultValue
string
Selected value on first render when uncontrolled (`value` undefined).
options*
DropdownOption[]
Available options (flat list). Each option's `font` previews the face, as in Dropdown.
groups
DropdownOptionGroup[]
Optional grouped options. When provided, renders groups with labels and separators.
placeholder
string
Shown on the right when nothing is selected.
disabled
boolean
false
Whether the dropdown is disabled.
size
"default" | "compact"
'default'
Component size, matching Button: `default` is 40px tall, `compact` 32px.
onValueChange
((value: string) => void)
Called with the newly selected value.
className
string
''
Additional CSS classes, applied to the wrapper.

Tested keys

An automated test presses every row below, in a left-to-right and a right-to-left layout.

Inspector dropdown follows the WAI-ARIA combobox pattern.

Keys the Inspector dropdown is tested against
KeyWhat it does
Arrow Down
Opens the list of options.
Arrow Down
With the list open, moves to the next option.
Arrow Up
Moves to the previous option.
Escape
Closes the list and keeps focus on the field.
tsx
// From the npm package
import { InspectorDropdown } from 'rift-ds/components/InspectorDropdown/InspectorDropdown';

// Or as source you own, via the shadcn CLI
npx shadcn@latest add https://rift-ds.com/r/inspector-dropdown.json

5.4 kB gzipped, with everything it imports. Peer dependencies are not counted.

For agents: the props, their allowed values and defaults, and the tested keys, as markdown or as a JSON schema.