Settings panel
The settings layout for an AI app: a sections nav and panes, with groups, rows, switches and segmented controls. The nav moves above the pane when the panel is narrow.
On this page
A finished settings surface: general, personalization, memory, connectors, project knowledge, usage and data controls, all live.
Installation
Usage
import {
SettingsGroup,
SettingsNav,
SettingsNavItem,
SettingsPane,
SettingsPanel,
SettingsRow,
SettingsSwitch,
} from "@/components/ui/chatcn/settings-panel"
<SettingsPanel defaultValue="general" className="h-[640px]">
<SettingsNav title="Settings">
<SettingsNavItem value="general" icon={<SettingsIcon />}>General</SettingsNavItem>
<SettingsNavItem value="memory" icon={<MemoryIcon />} meta={24}>Memory</SettingsNavItem>
</SettingsNav>
<SettingsPane value="general" title="General">
<SettingsGroup title="Chat">
<SettingsRow label="Send with Enter" description="Shift+Enter adds a new line.">
<SettingsSwitch defaultChecked />
</SettingsRow>
</SettingsGroup>
</SettingsPane>
<SettingsPane value="memory" title="Memory">…</SettingsPane>
</SettingsPanel>The layout follows the space it is given, not the viewport: a container query puts the nav in a column at 42 rem and wider, and in a scrolling row above the pane below that. Give the panel a height and each pane scrolls on its own.
Examples
Layout on its own
Sections nav, panes, groups and rows with switches and segmented controls. The nav moves above the pane when narrow.
Parts
| Part | Notes |
|---|---|
SettingsPanel | Root. value, defaultValue, onValueChange pick the open section |
SettingsNav | title above the sections, footer pinned under them in the column layout |
SettingsNavItem | value, icon, meta (a count or a word after the label) |
SettingsNavSeparator | Hairline between groups of sections, column layout only |
SettingsPane | value, title, description, actions |
SettingsGroup | title, description, action. Rows separated by hairlines, no card |
SettingsRow | label, description, note, disabled, stacked for wide controls |
SettingsSwitch | Base UI Switch. Names itself from the row's label and description |
SettingsSegmented | options, value, defaultValue, onValueChange, size xs or sm |
Keyboard
| Key | Action |
|---|---|
Up, Down | Move between sections in the column layout |
Left, Right | Move between sections in the row layout |
Enter, Space | Open the focused section, toggle a switch |
| Arrow keys in a segmented control | Move and select |
Accessibility
- The nav is a Base UI tablist inside a
navlandmark; arrow key orientation follows the layout, measured with a ResizeObserver. - Each group is a
sectionlabelled by its title. Switches and segmented controls takearia-labelledbyandaria-describedbyfrom their row, so the label is read once and the description after it. - Segmented controls are native radio inputs. Switches get a 44 px hit area on touch without changing the drawing.
Motion
- Panes swap instantly and the active section fill does not transition: people flip between sections often, usually from the keyboard.
- The switch thumb slides 150 ms with the track filling with ink. Under reduced motion it snaps.