SettingsLayout
settings-layoutSplit settings skeleton with vertical category navigation and grouped setting cards.
Usage
Basic split settings
Vertical category navigation on the left with grouped setting cards on the right; collapses to top navigation on narrow screens.
General settings
Manage basic workspace preferences
Preferences
- Auto saveAutomatically sync drafts while editing
- Compact modeTighten list spacing to show more rows
tsx
<SettingsLayout
items={[
{ value: "general", label: "General" },
{ value: "notifications", label: "Notifications" },
{ value: "security", label: "Security" },
]}
>
<SettingsPanel value="general" title="General settings" description="Manage basic workspace preferences">
<SettingSection title="Preferences">
<SettingRow title="Auto save" description="Automatically sync drafts while editing" control={<Switch defaultChecked />} />
</SettingSection>
</SettingsPanel>
</SettingsLayout>When to use
Use SettingsLayout for multi-section admin settings, workspace configuration, or user preference pages that pair a vertical category sidebar (automatically stacked on narrow viewports) with grouped setting cards. Use Layout for general app shells, or Tabs for simple tab switching.
Import
ts
import { SettingsLayout, SettingsPanel, SettingSection, SettingRow } from "@hulianui/ui"Props
SettingsLayout
| Name | Type | Default | Description |
|---|---|---|---|
items * | SettingsNavItem[] | - | Vertical category navigation items (value, label, icon, badge, disabled). |
value | string | - | Controlled active category value. |
defaultValue | string | first enabled item | Uncontrolled initial category value. |
SettingsNavItem
| Name | Type | Default | Description |
|---|---|---|---|
value * | string | - | Unique identifier matching SettingsPanel.value. |
label * | ReactNode | - | Navigation label text. |
icon | ReactNode | - | Leading icon constrained to 16px by the component. |
badge | ReactNode | - | Trailing status indicator such as a dot or count tag. |
disabled | boolean | false | Disables the navigation item when true. |
SettingsPanel
| Name | Type | Default | Description |
|---|---|---|---|
value * | string | - | Unique value matching SettingsNavItem.value. |
maxWidth | "sm" | "md" | "lg" | "full" | "lg" | Maximum width preset for the panel body. |
SettingSection
| Name | Type | Default | Description |
|---|---|---|---|
size | ListSize | "lg" | Row density forwarded to List.size. |
SettingRow
| Name | Type | Default | Description |
|---|---|---|---|
control | ReactNode | - | Single right-aligned form control (such as Switch, Select, or Input). |
actions | ReactNode[] | - | Multiple right-aligned action nodes; takes precedence over control when both are passed. |
Events
| Event | Type | Description |
|---|---|---|
SettingsLayout.onValueChange | (value: string) => void | Called when the active category changes. |
Slots
| Slot | Type | Description |
|---|---|---|
SettingsLayout.navHeader | ReactNode | Optional top area above the category navigation (for example, a search input). |
SettingsLayout.navFooter | ReactNode | Optional pinned bottom area below the category navigation. |
SettingsLayout.children | ReactNode | Right-hand content panels (SettingsPanel elements). |
SettingsPanel.title | ReactNode | Primary heading at the top of the panel. |
SettingsPanel.description | ReactNode | Supporting copy below the panel heading. |
SettingsPanel.extra | ReactNode | Right-aligned actions on the panel header row. |
SettingsPanel.children | ReactNode | Main body of the panel. |
SettingSection.title | ReactNode | Small heading above the grouped card. |
SettingSection.description | ReactNode | Optional subtitle below the section heading. |
SettingSection.extra | ReactNode | Trailing content on the section header row. |
SettingSection.children | ReactNode | SettingRow items inside the bordered list. |
SettingRow.title | ReactNode | Setting item title; optional when custom children is provided. |
SettingRow.description | ReactNode | Supporting description for the setting item. |
SettingRow.children | ReactNode | Custom left-side content that replaces the default title and description. |
Example
tsx
<SettingsLayout
items={[
{ value: "general", label: "General" },
{ value: "security", label: "Security" },
]}
>
<SettingsPanel value="general" title="General" description="Manage workspace preferences">
<SettingSection title="Notifications">
<SettingRow
title="Email alerts"
description="Receive updates for important changes"
control={<Switch defaultChecked />}
/>
</SettingSection>
</SettingsPanel>
</SettingsLayout>Usage guidelines
SettingsLayoutuses verticalTabsunder the hood; in controlled mode, pass bothvalueandonValueChangeinstead of mixing withdefaultValue.- When both
actionsandcontrolare provided onSettingRow,actionstakes precedence.
Related
Playground
General settings
Manage basic workspace preferences
Preferences
- Auto saveAutomatically sync drafts while editing
- Compact modeTighten list spacing to show more rows
<SettingsLayout items={items}>
<SettingsPanel value="general" maxWidth="lg" title="General settings">
<SettingSection title="Preferences">
<SettingRow title="Auto save" control={<Switch defaultChecked />} />
</SettingSection>
</SettingsPanel>
</SettingsLayout>