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
- ProPro · unlocked
- 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
"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.
| Type | Notes | ||
|---|---|---|---|
title | React.ReactNode | No | – |
description | React.ReactNode | No | – |
sections | SettingsSectionLink[] | No | The sections, in order, for the list on the side. Ids match each SettingsSection. |
dirty | boolean | No | Something has changed since the last save: shows the save bar. |
onSave | () => void | Promise<void> | No | Save. May return a promise; throw to show why it failed. |
onDiscard | () => void | No | Put the changes back. |
guardUnsaved | boolean | No | Ask before leaving with unsaved changes. Default true. |
searchable | boolean | No | Show the search box. Default true. |
saveLabel | string | No | – |
Dependencies
npm packages
clsxframer-motionlucide-reacttailwind-mergeLiro foundations, installed alongside it
liro-themebuttonStates
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