Dashral Pro is on the wayGet 30% off at launch

Dashral

Settings sidebar

Grouped settings with a sliding highlight and the picked section beside them; a select on phones.

$ pnpm dlx shadcn@latest add @dashral/settings-sidebar

When to use

  • A settings page: grouped sections with a sliding highlight, and the section you pick beside them.
  • Account and workspace settings with several sections; a select takes over on phones.

When not to use

  • An app's main navigation: Dashboard sidebar.
  • Settings with two or three sections: tabs are enough.

Usage

Settings sidebar with your own data: every prop has the sample as its default, so pass only what you have.

example.tsx
import { SettingsSidebar } from "@/components/dashral/blocks/settings-sidebar"

<SettingsSidebar
  groups={settingsGroups}
  current={section}
  onNavigate={(id) => router.push(`/settings/${id}`)}
  content={(page) => <SettingsSection id={page.id} />}
/>

API reference

SettingsSidebar

A settings page: grouped sections on the left with a highlight that slides to the one you pick, and that section on the right. On phones the sections are a select above the content. Your sections come in groups, the one shown is controllable (onNavigate when it changes), and content renders each one; the sample forms render without it.

PropTypeDefault
groupsSettingsGroup[]sample
currentstring

The section shown, by id (the block keeps it without it).

—
onNavigate(id: string) => void—
content(page: SettingsPage) => React.ReactNodesample

type SettingsPage

One settings section: its place in the nav and the title above its content.

PropTypeDefault
idstring—
labelstring—
iconReact.ReactNode—
descriptionstring—
badgeReact.ReactNode—
countnumber—

type SettingsGroup

PropTypeDefault
labelstring—
pagesSettingsPage[]—