Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Containers

  • Layout
  • AdminLayout
  • SettingsLayout
  • ScrollArea
  • Viewport
  • Resizable
  • AspectRatio
  • FitScreen
  • PreviewSandbox
  • Masonry
  • Container
  • AccentScope

Arrangement

  • Stack
  • Grid
  • Spacer
  • Divider
  • Separator

SettingsLayout

settings-layout

Split 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 save
    Automatically sync drafts while editing
  • Compact mode
    Tighten 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

NameTypeDefaultDescription
items *SettingsNavItem[]-Vertical category navigation items (value, label, icon, badge, disabled).
valuestring-Controlled active category value.
defaultValuestringfirst enabled itemUncontrolled initial category value.

SettingsNavItem

NameTypeDefaultDescription
value *string-Unique identifier matching SettingsPanel.value.
label *ReactNode-Navigation label text.
iconReactNode-Leading icon constrained to 16px by the component.
badgeReactNode-Trailing status indicator such as a dot or count tag.
disabledbooleanfalseDisables the navigation item when true.

SettingsPanel

NameTypeDefaultDescription
value *string-Unique value matching SettingsNavItem.value.
maxWidth"sm" | "md" | "lg" | "full""lg"Maximum width preset for the panel body.

SettingSection

NameTypeDefaultDescription
sizeListSize"lg"Row density forwarded to List.size.

SettingRow

NameTypeDefaultDescription
controlReactNode-Single right-aligned form control (such as Switch, Select, or Input).
actionsReactNode[]-Multiple right-aligned action nodes; takes precedence over control when both are passed.

Events

EventTypeDescription
SettingsLayout.onValueChange(value: string) => voidCalled when the active category changes.

Slots

SlotTypeDescription
SettingsLayout.navHeaderReactNodeOptional top area above the category navigation (for example, a search input).
SettingsLayout.navFooterReactNodeOptional pinned bottom area below the category navigation.
SettingsLayout.childrenReactNodeRight-hand content panels (SettingsPanel elements).
SettingsPanel.titleReactNodePrimary heading at the top of the panel.
SettingsPanel.descriptionReactNodeSupporting copy below the panel heading.
SettingsPanel.extraReactNodeRight-aligned actions on the panel header row.
SettingsPanel.childrenReactNodeMain body of the panel.
SettingSection.titleReactNodeSmall heading above the grouped card.
SettingSection.descriptionReactNodeOptional subtitle below the section heading.
SettingSection.extraReactNodeTrailing content on the section header row.
SettingSection.childrenReactNodeSettingRow items inside the bordered list.
SettingRow.titleReactNodeSetting item title; optional when custom children is provided.
SettingRow.descriptionReactNodeSupporting description for the setting item.
SettingRow.childrenReactNodeCustom 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

  • SettingsLayout uses vertical Tabs under the hood; in controlled mode, pass both value and onValueChange instead of mixing with defaultValue.
  • When both actions and control are provided on SettingRow, actions takes precedence.

Related

  • Layout
  • Tabs
  • List

Playground

General settings

Manage basic workspace preferences

Preferences

  • Auto save
    Automatically sync drafts while editing
  • Compact mode
    Tighten 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>
PreviousAdminLayoutLayoutNextScrollArea

On this page

  • Usage
  • Documentation
    • When to use
    • Import
    • Props
    • Events
    • Slots
    • Example
    • Usage guidelines
    • Related
  • Playground