Settings group
A titled card of rows, label left and control right; a link row ends with a chevron.
import { SettingsGroup, SettingsRow } from "@forgeron/ui";Notifications
Email digestOne email a day, at 8:00.
LanguageEnglishimport { SettingsGroup, SettingsRow, Switch } from "@forgeron/ui";
export default function Default() {
return (
<div style={{ width: 380 }}>
<SettingsGroup title="Notifications">
<SettingsRow label="Email digest" description="One email a day, at 8:00.">
<Switch label="" aria-label="Email digest" defaultChecked />
</SettingsRow>
<SettingsRow
label="Language"
href="#/settings/language"
value="English"
onNavigate={() => {}}
/>
</SettingsGroup>
</div>
);
}Workspace
What everyone in Maison Roy sees.
NameShown in the sidebar and in emails.
Week starts on
MembersPeople and their teams.48 peopleIdentity providerMicrosoft Entra IDSecurity
Two-step sign-inAsked of every member at sign-in.
import { Button, Select, SettingsGroup, SettingsRow, Switch } from "@forgeron/ui";
import { useState } from "react";
export default function SettingsPage() {
const [opened, setOpened] = useState<string | null>(null);
return (
<div style={{ display: "grid", gap: 32, width: "100%", maxWidth: 620 }}>
<SettingsGroup title="Workspace" description="What everyone in Maison Roy sees.">
<SettingsRow label="Name" description="Shown in the sidebar and in emails.">
<Button size="sm">Rename</Button>
</SettingsRow>
<SettingsRow label="Week starts on">
<Select
aria-label="Week starts on"
defaultValue="monday"
options={[
{ value: "monday", label: "Monday" },
{ value: "sunday", label: "Sunday" },
]}
/>
</SettingsRow>
<SettingsRow
label="Members"
description="People and their teams."
href="#/settings/members"
value="48 people"
onNavigate={(href) => setOpened(href)}
/>
<SettingsRow
label="Identity provider"
href="#/settings/sso"
value="Microsoft Entra ID"
onNavigate={(href) => setOpened(href)}
/>
</SettingsGroup>
<SettingsGroup title="Security">
<SettingsRow label="Two-step sign-in" description="Asked of every member at sign-in.">
<Switch label="" aria-label="Two-step sign-in" />
</SettingsRow>
</SettingsGroup>
{opened ? <p style={{ margin: 0, color: "var(--ink-muted)" }}>Opened: {opened}</p> : null}
</div>
);
}Danger zone
These cannot be undone.
Transfer ownershipAnother owner takes over billing.
Delete the workspaceIts tools, data and members.
import { Button, SettingsGroup, SettingsRow } from "@forgeron/ui";
// Last on the page, outlined in red.
export default function DangerZone() {
return (
<div style={{ width: "100%", maxWidth: 620 }}>
<SettingsGroup tone="danger" title="Danger zone" description="These cannot be undone.">
<SettingsRow label="Transfer ownership" description="Another owner takes over billing.">
<Button size="sm">Transfer</Button>
</SettingsRow>
<SettingsRow label="Delete the workspace" description="Its tools, data and members.">
<Button size="sm" variant="danger">
Delete
</Button>
</SettingsRow>
</SettingsGroup>
</div>
);
}API → Props
| Prop | Type | Default | Description |
|---|---|---|---|
title / description | ReactNode | — | Of the group. |
tone | "default" | "danger" | "default" | A danger zone, outlined in red. Last on the page. |
SettingsRow label / description | ReactNode | — | Left: what the setting is. |
SettingsRow children | ReactNode | — | Right: a switch, a select, a button, a value. |
SettingsRow href / value | string / ReactNode | — | The row links to a sub-page, its current value before the chevron. |
SettingsRow onNavigate | (href, event) => void | — | Routes a plain click without a page load. |
className | string | — | Extra classes. |