Skip to content
Eskais UI

Blocks

Settings Page

SettingsPage: a section navigation that sticks beside the sections on wide containers and becomes a section picker on narrow ones, marking the section being read (IntersectionObserver). Going to a section scrolls by id and focuses its heading, so it works under hash routers; the section can live in the URL through createUrlParam. SettingsSection, SettingsRow (a label, a description and the control on the right, stacking when narrow), SettingsFacts (a DescriptionList for read-only facts) and SettingsDangerZone with SettingsDangerAction rows that confirm through ConfirmDialog and need a person's approval for agents.

Example

Account

How you appear to your team.

Shown on comments and approvals.

A weekly summary of your projects.

Security

Protect your account and your sessions.

Ask for a code from your authenticator app.

When you are inactive for this long.

Other sessions

3 browsers and 1 phone are signed in.

This device

What this browser reports about itself.

Name
Studio MacBook
Operating system
macOS 15.2
Browser
Safari 18
Signed in
12 March 2026
Last address
203.0.113.24

Notifications

Where we tell you about activity.

When someone mentions you in a comment.

When a run you started fails.

A few times a year.

Danger zone

These can't be undone.

Forget this device

Signs this browser out and removes its saved keys.

Delete account

Removes your account, your projects and their history.

Installation

npx shadcn@latest add @eskais/settings-page

Usage

Import
import {  PendingSectionContext,  useObservedSection,  usePendingSection,  useSectionMounted,  useUrlSection,} from "@/components/ui/use-settings-page"import {  SettingsDangerAction,  SettingsDangerZone,  SettingsFacts,  SettingsPage,  settingsPageLabels,  SettingsRow,  SettingsSection,} from "@/components/ui/settings-page"

A settings or device page: SettingsSections of SettingsRows, SettingsFacts for read-only facts and a SettingsDangerZone, with a navigation that follows your scroll.

API reference

SettingsPage

PropTypeDefault
sectionsThe navigation's entries. By default, every direct `SettingsSection` child's `id` and `navLabel` or text title.readonly SettingsSectionLink[]–
currentSectionThe section marked current; set it to follow your own state, otherwise it follows scrolling.string–
onSectionChange(id: string, details: { reason: SettingsSectionChangeReason }) => void–
urlKeeps the section in the URL and scrolls to it on load and on Back: `createUrlParam("section")` from `@/lib/url-param`, which never touches `location.hash`, or `createUrlParam("section", { router: hashRouter() })` for `#/settings?section=id` inside a hash route. Its `href` builds the navigation's links. A section that renders later, like after its data loads, is scrolled to when it mounts, unless the person has acted since.UrlParamAdapter–
getHrefA navigation entry's href, for opening in a new tab: by default the `url` adapter's href for the section, else `#id`. A plain click scrolls without following it.(id: string) => string–
navigation`links` (default): the navigation's entries are links to each section, which open in a new tab. `buttons`: buttons that scroll to a section, for a page whose sections have no address of their own."links" | "buttons""links"
labelsPartial<SettingsPageLabels>–
style`--settings-top` (0 by default): the height of anything sticky above the page, like a topbar. `--settings-height` (the viewport by default): the height of the box that scrolls the page, for a page inside a pane.CSSProperties–

Also takes <div> attributes except onChange.

SettingsSection

PropTypeDefault
idrequiredThe anchor the navigation scrolls to.string–
titlerequiredReactNode–
navLabelThe navigation's text for it, when `title` isn't plain text.string–
descriptionReactNode–
actionsButtons beside the title, like Save.ReactNode–
tone`destructive` edges the box in the destructive tone, for a danger zone."default" | "destructive""default"
surface`card` (default) puts the content in a box whose rows are divided; `none` leaves it bare."card" | "none""card"
headingLevel2 | 32

Also takes <section> attributes except title.

SettingsRow

PropTypeDefault
labelrequiredReactNode–
descriptionReactNode–
childrenThe control on the right; it moves under the label when the row gets narrow.ReactNode–
field`true` (default) wraps the row in a `Field`, so the label and description name and describe a UI SDK control in it (Switch, Select, Input). `false` for a row whose control names itself, like a Button or a ConfirmDialog.booleantrue

Also takes <div> attributes except children.

SettingsDangerAction

PropTypeDefault
labelrequiredReactNode–
descriptionReactNode–
triggerrequiredThe button that opens the confirmation.ReactNode–
titlerequiredThe confirmation's title, like "Delete this device?".ReactNode–
consequenceWhat confirming does, said to the person in the dialog.ReactNode–
confirmLabelrequiredThe confirm button: words that aren't the trigger's, like "Delete forever".ReactNode–
agentConfirmrequiredThe sentence an agent must show a person before confirming; becomes `data-agent-confirm`.string–
onConfirmrequired() => unknown–
cancelLabelThe cancel button, in the page's language.ReactNode–
disabledThe trigger can't be pressed, like while the action isn't allowed.boolean–
pendingThe action is running elsewhere: the trigger shows a spinner, is `aria-busy` and ignores presses.boolean–

Also takes <div> attributes except children, label, description, children, field.

SettingsFacts

Takes DescriptionListProps.

SettingsDangerZone

PropTypeDefault
idrequiredThe anchor the navigation scrolls to.string–
titlerequiredReactNode–
navLabelThe navigation's text for it, when `title` isn't plain text.string–
descriptionReactNode–
actionsButtons beside the title, like Save.ReactNode–
surface`card` (default) puts the content in a box whose rows are divided; `none` leaves it bare."card" | "none"–
headingLevel2 | 3–

Also takes <section> attributes except title, tone.

Other exports

PendingSectionContextuseObservedSectionusePendingSectionuseSectionMounteduseUrlSectionsettingsPageLabelstype SettingsDangerActionPropstype SettingsPageLabelstype SettingsPagePropstype SettingsRowPropstype SettingsSectionChangeReasontype SettingsSectionLinktype SettingsSectionProps

Accessibility

  • The navigation is a named landmark; the section being read has aria-current=location.
  • Going to a section scrolls by id and moves focus to its heading, without touching location.hash, so hash routers keep their route.
  • Section links take their href from the url adapter (#/settings?section=id through a hash router), so a new tab opens the route; navigation="buttons" scrolls without an address.
  • Each section is a region named by its title and described by its description; each row's label names its control.
  • SettingsDangerAction disabled and pending reach its trigger: disabled, or busy with a spinner while it keeps focus; the dialog doesn't open, for agents either.

Agent actions

Agents follow a section's link or set the section picker by name, set each row's control by its label, and need a person's approval to confirm a danger action.

Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.