This page as markdown: /settings-menu.md · Index for agents: /llms.txt · Everything in one file: /llms-full.txt

SettingsMenu

Status: stable

A compact trigger that states the current settings, over a menu of rows that change them. Each row shows its own value and opens a submenu; with one setting, the menu opens straight to its options under the row's label.

Keywords: settings, model picker, model switcher, options menu, preferences, submenu, quality settings, ai chat

Usage

For a cluster of related settings that a reader checks often and changes occasionally — the model and effort on an AI composer, quality and format on an export control, density and sort on a table. It encodes one shape: summarise the state on the trigger, then open to a list of name → current value → submenu. It knows nothing about any particular domain; the AI-model case is one instance of it.

Best practices

Anatomy

Part Required Description
Trigger yes The summary control. States the current settings and carries a chevron; quiet at rest, so it does not compete with the primary action beside it.
SettingsRow yes One setting: its name, its current value, and a submenu of options. Without children it renders flat, for a row that is a statement rather than a choice.
Submenu contents no Usually a MenuRadioGroup of MenuRadioItems, so the active option is checked.

Subcomponents

Name Type Description
SettingsRow { label: ReactNode; value?: ReactNode; disabled?: boolean; children?: ReactNode } One setting. With children it opens a submenu; without them it renders as a flat statement row.
MenuRadioGroup { value?: string; defaultValue?: string; onValueChange?: (value: string) => void } Single-choice group for a row's submenu. Exported from Menu; re-used here rather than duplicated.
MenuRadioItem { value: string; disabled?: boolean } One option, with a check in a reserved leading column so labels do not shift as the highlight moves.

Props

Name Type Default Description
summary ReactNode — What the trigger reads when closed. Give it the current values, not a noun — the control should answer before it is opened.
label string "Change settings" Accessible name for the trigger, since the visible summary is data rather than a label.
variant "ghost" | "subtle" "ghost" Resting treatment. ghost disappears into the surface at rest and shows its affordance on hover — right for a toolbar. subtle adds a fill for surfaces where a ghost trigger would float unanchored.
size "xs" | "sm" "sm" Trigger height, read off the density ladder so a compact scope retunes it with every other control.
side "top" | "bottom" | "inline-start" | "inline-end" "top" Which side the menu opens on. Upward by default — its home is the bottom of a composer.
align "start" | "center" | "end" "end" Alignment along that side.
disabled boolean — Disable the trigger.
...Menu props Omit<ComponentProps, 'children'> — open / defaultOpen / onOpenChange and the rest of Base UI's menu root props.

Variants

Tokens used

foreground, muted, muted-foreground, accent, accent-foreground, popover, popover-foreground, border, ring

Accessibility

Related

Examples

A model switcher in a composer

import { ChatComposer, MenuRadioGroup, MenuRadioItem, SettingsMenu, SettingsRow } from "@sableui/react"

<ChatComposer
	onSend={send}
	actions={
		<SettingsMenu variant="subtle" size="xs" summary={<><span className="text-foreground">{model.name}</span>{" "}<span className="text-muted-foreground">{effort}</span></>}>
			<SettingsRow label="Model" value={model.name}>
				<MenuRadioGroup value={model.id} onValueChange={setModelId}>
					<MenuRadioItem value="sol">5.6 Sol</MenuRadioItem>
					<MenuRadioItem value="lite">5.6 Lite</MenuRadioItem>
				</MenuRadioGroup>
			</SettingsRow>
			<SettingsRow label="Effort" value={effort}>
				<MenuRadioGroup value={effort} onValueChange={setEffort}>
					<MenuRadioItem value="Low">Low</MenuRadioItem>
					<MenuRadioItem value="High">High</MenuRadioItem>
				</MenuRadioGroup>
			</SettingsRow>
		</SettingsMenu>
	}
/>

Export options — the same shape, no chat involved

import { MenuRadioGroup, MenuRadioItem, SettingsMenu, SettingsRow } from "@sableui/react"

<SettingsMenu summary={`${format} · ${quality}`} side="bottom" align="start">
	<SettingsRow label="Format" value={format}>
		<MenuRadioGroup value={format} onValueChange={setFormat}>
			<MenuRadioItem value="PNG">PNG</MenuRadioItem>
			<MenuRadioItem value="SVG">SVG</MenuRadioItem>
		</MenuRadioGroup>
	</SettingsRow>
	<SettingsRow label="Quality" value={quality}>
		<MenuRadioGroup value={quality} onValueChange={setQuality}>
			<MenuRadioItem value="Draft">Draft</MenuRadioItem>
			<MenuRadioItem value="Final">Final</MenuRadioItem>
		</MenuRadioGroup>
	</SettingsRow>
</SettingsMenu>

A flat row for a setting with nothing to choose

import { MenuRadioGroup, MenuRadioItem, MenuSeparator, SettingsMenu, SettingsRow } from "@sableui/react"

<SettingsMenu summary="Standard">
	<SettingsRow label="Speed" value="Standard">
		<MenuRadioGroup value="standard">
			<MenuRadioItem value="standard">Standard</MenuRadioItem>
			<MenuRadioItem value="priority">Priority</MenuRadioItem>
		</MenuRadioGroup>
	</SettingsRow>
	<MenuSeparator />
	<SettingsRow label="Plan" value="Team" />
</SettingsMenu>