Settings Page

The settings screen: sections, a list to jump around, search, and a save bar that appears on change.

PROGet Settings Page and 168 other Pro components with pro lifetime — Get Pro

Category
Workspace
Access
Pro
Source
461 lines · one file
States
9 drawn
Kind
Block
Added
13 Oct 2026

When to use it

Use Settings Page for an account or workspace settings screen: a section list with scroll-spy, search across rows, and a save bar that appears when something changed, with an async save and an unsaved-changes guard. Build it from SettingsSection and SettingsRow.

Installation

How you get it

Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.

Use Liro's Settings Page for this.
Install it: npx shadcn@latest add @liro/settings-page
(the @liro registry is set up in components.json, with LIRO_KEY in .env.local)
Import it from @/components/ui/settings-page.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.

For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Pro components install through the @liro registry with your CLI token: see the Namespaced tab.

Usage

app/settings/page.tsx
"use client";

import * as React from "react";
import { SettingsPage, SettingsRow, SettingsSection } from "@/components/ui/settings-page";
import { Input } from "@/components/ui/input";
import { Switch } from "@/components/ui/switch";

export default function Settings() {
  const [name, setName] = React.useState("Madgixs");
  const [saved, setSaved] = React.useState("Madgixs");
  return (
    <SettingsPage
      title="Settings"
      sections={[{ id: "general", title: "General" }, { id: "notifications", title: "Notifications" }]}
      dirty={name !== saved}
      onSave={async () => setSaved(name)}
      onDiscard={() => setName(saved)}
    >
      <SettingsSection id="general" title="General">
        <SettingsRow label="Workspace name" htmlFor="ws-name">
          <Input id="ws-name" value={name} onChange={(e) => setName(e.target.value)} />
        </SettingsRow>
      </SettingsSection>
      <SettingsSection id="notifications" title="Notifications">
        <SettingsRow label="Email me when a document is signed">
          <Switch defaultChecked aria-label="Email me when a document is signed" />
        </SettingsRow>
      </SettingsSection>
    </SettingsPage>
  );
}

API reference

“Copy prompt” above puts a full brief on your clipboard, install command, dependencies, props, and the mistakes an assistant usually makes with this component.

Props

Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.

TypeNotes
titleReact.ReactNode No–
descriptionReact.ReactNode No–
sectionsSettingsSectionLink[] NoThe sections, in order, for the list on the side. Ids match each SettingsSection.
dirtyboolean NoSomething has changed since the last save: shows the save bar.
onSave() => void | Promise<void> NoSave. May return a promise; throw to show why it failed.
onDiscard() => void NoPut the changes back.
guardUnsavedboolean NoAsk before leaving with unsaved changes. Default true.
searchableboolean NoShow the search box. Default true.
saveLabelstring No–

Dependencies

npm packages

clsxframer-motionlucide-reacttailwind-merge

Liro foundations, installed alongside it

liro-themebutton

States

All of them are drawn by the component. None is left for you to design.

  • Saved
  • Unsaved changes
  • Saving
  • Save failed
  • Saved confirmation
  • Search
  • No matches
  • Danger zone
  • Narrow

Accessibility

  • Keyboard reachable throughout, in visual order
  • Focus trapped in overlays, Escape closes them
  • Focus returns to whatever opened it
  • Live regions announce what changed, not that something did
  • Honours prefers-reduced-motion

Responsive behavior

  • Sizes to its container, not the viewport
  • Usable from 320px up
  • Pointer-based interaction, so trackpad and touch both work
  • No hover-only affordances

Used in a screenAll screens