Skip to content
HomeCobalt

Settings layout

Lays out a settings page: the list of sections beside the one that is open on a wide screen, and on a phone the list as a page of its own that each section replaces, with a link back.

Examples

A settings page built from groups and rows: switches and pickers save on the press and say so in the row, the profile saves as you type, and a device signs out at once with Undo.
Back to settings

Account

Profile

Shown on your notes and shared searches.

Where filing alerts go.

Region

Notifications

Email

When a fund you follow files a 13F, an N-PORT or a Form D.

When a fund you follow misses its deadline.

Every Monday at 8:00 AM, what changed last week.

Display

Tables

Compact fits more rows on a screen.

Dates

For calendars and weekly totals.

Devices

Signed in

Active now

This device

Last active 2 hours ago

Last active 3 weeks ago

Usage

Use it when

  • An app's account, notification, privacy and display settings, more than 2 sections of them.
  • An admin area of sections that each hold a form or a list of switches.

Use something else when

  • A page with 1 or 2 groups of settings. Use Card instead, one per group, on one page.
  • Views of one record. Use Tabs instead.
  • The app's main sections. Use Nav instead.

Rules

General

Content

Avoid

Limits

Install

npx shadcn@latest add https://kaanarici.com/r/cobalt/settings-layout.json https://kaanarici.com/r/cobalt/use-undoable.json
import { SettingsLayout, SettingsPanel, SettingsGroup, SettingsRow, type SettingsSection } from "@/components/cobalt/ui/settings-layout"
import { useUndoable, pendingCommit, UNDO_WINDOW_MS } from "@/lib/cobalt/use-undoable"