# Settings panel

A native settings form for controlled toggles, selects, radio choices, and consumer-owned apply or reset behavior.

Access: pro. Category: Blocks. Kind: composite.

## When to use

- Use it when a page needs a native settings form for controlled toggles, selects, radio choices, and consumer-owned apply or reset behavior.
- Choose it for a settings workflow where saved state, validation, and side effects remain in the host application.

## Alternatives

- Choose empty-state instead when empty collections, search results and errors with a clear next action is the actual interface need, rather than settings panel.

## Setup for agents

Use React 19 and TypeScript. Initialize shadcn for your framework, then merge this exact entry into components.json:

```json
{
  "registries": {
    "@tidal-pro": {
      "url": "https://tidalui.com/r/pro/{name}.json",
      "headers": {
        "Authorization": "Bearer ${TIDALUI_TOKEN}"
      }
    }
  }
}
```

The namespace must be named **@tidal-pro** because transitive Pro dependencies use that namespace. Obtain an agent key from your active Pro account at https://tidalui.com/account. Keep TIDALUI_TOKEN in your local environment, never in components.json, client code, Git or logs.

```sh
export TIDALUI_TOKEN='your-private-agent-key'
npx shadcn@latest add @tidal-pro/waitlist-form
npx shadcn@latest add https://tidalui.com/r/tidal-button.json
```

Free command: `npx shadcn@latest add https://tidalui.com/r/<name>.json`.
Pro command: `npx shadcn@latest add @tidal-pro/<name>`.

Import the base stylesheet and every stylesheet listed on the installed item's metadata. For example:

```tsx
import "./components/ui/tidal.css";
import "./components/ui/hero-section.css";
// Place installed components inside this wrapper:
<div className="tidal-scope" data-theme="dark">...</div>
```

Omit data-theme for the default light theme. Put the attribute on the same tidal-scope element for dark mode. Every component installs the shared free tidal-base dependency. After upgrading, run `npx shadcn@latest add https://tidalui.com/r/tidal-base.json --overwrite` to receive current tokens. Review local modifications before overwriting.

Vite: Use React + TypeScript. Map @/* to ./src/* in paths and Vite resolve.alias. Import tidal.css and each component stylesheet in your application entry.

Next.js 15 App Router: Next.js App Router: import tidal.css and component CSS in app/layout.tsx. Interactive examples belong in a client component with "use client". Map @/* to ./* or ./src/* to match your project.

TypeScript 6: use paths without baseUrl:

```json
{
  "compilerOptions": {
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
  }
}
```

Pro registry requests are server/CLI-only. Use the same-origin account interface in a browser; cross-origin Authorization preflights are intentionally unsupported.


## Install Settings panel

```sh
npx shadcn@latest add @tidal-pro/settings-panel
```

Stylesheets: `components/ui/tidal.css`, `components/ui/settings-panel.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/settings-panel.css";
import{TidalSettingsPanel}from"./components/ui/settings-panel";
export default()=><div className="tidal-scope"><TidalSettingsPanel groups={[{id:"example",title:"Demo",fields:[{kind:"toggle",checked:false,onCheckedChange:() => {},id:"example",name:"Demo",label:"Demo"}]}]} title={"Demo"}/></div>;
```

## Structured props

- `TidalSettingsPanel.groups: ReadonlyArray<TidalSettingsGroup>`: Required groups value accepted by this exported component.
- `TidalSettingsPanel.title: ReactNode`: Required title value accepted by this exported component.
- `TidalSettingsPanel.applyButtonProps?: Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> | undefined`: Optional apply button props value accepted by this exported component.
- `TidalSettingsPanel.applyLabel?: ReactNode` (default "Apply changes"): Optional apply label value accepted by this exported component.
- `TidalSettingsPanel.applyRef?: Ref<HTMLButtonElement> | undefined`: Optional apply ref value accepted by this exported component.
- `TidalSettingsPanel.description?: ReactNode`: Optional description value accepted by this exported component.
- `TidalSettingsPanel.disabled?: boolean | undefined` (default false): Optional disabled value accepted by this exported component.
- `TidalSettingsPanel.emptyMessage?: ReactNode` (default "No settings are available."): Optional empty message value accepted by this exported component.
- `TidalSettingsPanel.eyebrow?: ReactNode` (default "Settings"): Optional eyebrow value accepted by this exported component.
- `TidalSettingsPanel.headingLevel?: "h2" | "h3" | "h4" | undefined` (default "h2"): Optional heading level value accepted by this exported component.
- `TidalSettingsPanel.resetButtonProps?: Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> | undefined`: Optional reset button props value accepted by this exported component.
- `TidalSettingsPanel.resetLabel?: ReactNode` (default "Reset"): Optional reset label value accepted by this exported component.
- `TidalSettingsPanel.resetRef?: Ref<HTMLButtonElement> | undefined`: Optional reset ref value accepted by this exported component.
- `TidalSettingsPanel.summary?: ReactNode`: Optional summary value accepted by this exported component.
- `TidalSettingsPanel.summaryProps?: Omit<HTMLAttributes<HTMLDivElement>, "children"> | undefined`: Optional summary props value accepted by this exported component.

## Complete usage example

[Source](https://tidalui.com/examples/settings-panel.tsx) | [Manifest](https://tidalui.com/examples/settings-panel.json). Install the listed additional dependencies. Consumer fixture: TypeScript pass; Vite pass. This fixture check is distinct from the actual shadcn install receipt.

```tsx
"use client";

import "./components/ui/tidal.css";

import { useId, useLayoutEffect, useRef, useState } from "react";

import { TidalSettingsPanel, type TidalSettingsGroup } from "./components/ui/settings-panel";

import "./components/ui/settings-panel.css";



const tidalExampleStyles = ".tidal-scope .settings-panel-demo,\n.tidal-scope .settings-panel-demo * {\n  box-sizing: border-box;\n}\n\n.tidal-scope .settings-panel-demo {\n  width: 100%;\n  min-width: 0;\n  padding: clamp(14px, 3.2vw, 38px);\n  color: var(--t-ink);\n  background:\n    linear-gradient(var(--t-border) 1px, transparent 1px),\n    linear-gradient(90deg, var(--t-border) 1px, transparent 1px),\n    var(--t-subtle);\n  background-size: 24px 24px;\n  border-radius: 22px;\n  container: settings-demo / inline-size;\n}\n\n.tidal-scope .settings-panel-demo-layout {\n  display: grid;\n  width: 100%;\n  max-width: 1040px;\n  min-width: 0;\n  gap: 16px;\n  margin: 0 auto;\n}\n\n.tidal-scope .settings-panel-demo-page {\n  min-width: 0;\n  padding: 18px;\n  color: var(--t-ink);\n  background: var(--t-surface);\n  border: 1px solid var(--t-border);\n  border-radius: 18px;\n  box-shadow: 0 20px 45px -40px #00000070;\n}\n\n.tidal-scope .settings-panel-demo-page > header,\n.tidal-scope .settings-panel-demo-page > footer {\n  display: flex;\n  min-width: 0;\n  align-items: flex-end;\n  justify-content: space-between;\n  gap: 16px;\n}\n\n.tidal-scope .settings-panel-demo-page > header > div {\n  min-width: 0;\n}\n\n.tidal-scope .settings-panel-demo-page > header span,\n.tidal-scope .settings-panel-demo-page > footer span {\n  color: var(--t-muted);\n  font-size: 11px;\n  font-weight: 650;\n  letter-spacing: 0.08em;\n  line-height: 1.45;\n  text-transform: uppercase;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .settings-panel-demo-page h3 {\n  margin: 5px 0 0;\n  font-size: 22px;\n  font-weight: 560;\n  letter-spacing: -0.035em;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .settings-panel-demo-page > header > span {\n  text-align: end;\n}\n\n.tidal-scope .settings-panel-demo-page-grid {\n  display: grid;\n  grid-template-columns: minmax(120px, 0.45fr) minmax(0, 1fr);\n  gap: 10px;\n  min-width: 0;\n  margin: 17px 0;\n}\n\n.tidal-scope .settings-panel-demo-page ul,\n.tidal-scope .settings-panel-demo-page-content {\n  min-width: 0;\n  padding: 12px;\n  background: var(--t-subtle);\n  border: 1px solid var(--t-border);\n  border-radius: 10px;\n}\n\n.tidal-scope .settings-panel-demo-page ul {\n  display: flex;\n  flex-direction: column;\n  margin: 0;\n  list-style: none;\n}\n\n.tidal-scope .settings-panel-demo-page ul > li {\n  display: flex;\n  min-height: 36px;\n  align-items: center;\n  padding-inline: 10px;\n  color: var(--t-muted);\n  border-inline-start: 2px solid transparent;\n  font-size: 11px;\n  line-height: 1.4;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .settings-panel-demo-page[data-density=\"compact\"] ul > li {\n  min-height: 28px;\n}\n\n.tidal-scope .settings-panel-demo-page ul > li[data-active=\"true\"] {\n  color: var(--t-ink);\n  background: var(--t-surface);\n  border-inline-start-color: var(--t-ink);\n}\n\n.tidal-scope .settings-panel-demo-page-content {\n  display: flex;\n  min-height: 124px;\n  flex-direction: column;\n  justify-content: center;\n  gap: 7px;\n}\n\n.tidal-scope .settings-panel-demo-page-content strong {\n  font-size: 14px;\n  font-weight: 620;\n  line-height: 1.4;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .settings-panel-demo-page-content span {\n  max-width: 54ch;\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.6;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .settings-panel-demo-page > footer {\n  align-items: center;\n  padding-top: 15px;\n  border-top: 1px solid var(--t-border);\n}\n\n.tidal-scope .settings-panel-demo-page > footer strong {\n  font-size: 11px;\n  font-weight: 650;\n}\n\n.tidal-scope .settings-panel-demo-boundary {\n  margin: 0;\n  padding: 0 4px;\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.6;\n  text-align: center;\n  overflow-wrap: anywhere;\n}\n\n@container settings-demo (max-width: 480px) {\n  .tidal-scope .settings-panel-demo {\n    padding: 10px;\n    background-size: 18px 18px;\n    border-radius: 18px;\n  }\n\n  .tidal-scope .settings-panel-demo-page {\n    padding: 15px;\n  }\n\n  .tidal-scope .settings-panel-demo-page > header {\n    align-items: flex-start;\n    flex-direction: column;\n    gap: 7px;\n  }\n\n  .tidal-scope .settings-panel-demo-page > header > span {\n    text-align: start;\n  }\n\n  .tidal-scope .settings-panel-demo-page-grid {\n    grid-template-columns: minmax(0, 1fr);\n  }\n}";

type Density = "comfortable" | "compact";

type StartView = "overview" | "activity";

interface SamplePreferences {
  density: Density;
  startView: StartView;
  weeklyDigest: boolean;
}

const INITIAL_PREFERENCES: SamplePreferences = {
  density: "comfortable",
  startView: "overview",
  weeklyDigest: false,
};

const DENSITY_LABELS: Record<Density, string> = {
  comfortable: "Comfortable",
  compact: "Compact",
};

const VIEW_LABELS: Record<StartView, string> = {
  overview: "Overview",
  activity: "Activity",
};

function samePreferences(first: SamplePreferences, second: SamplePreferences) {
  return (
    first.density === second.density &&
    first.startView === second.startView &&
    first.weeklyDigest === second.weeklyDigest
  );
}

export function SettingsPanelDemo() {
  const pageTitleId = useId();
  const pageTitleRef = useRef<HTMLHeadingElement>(null);
  const focusPageAfterApply = useRef(false);
  const [draft, setDraft] = useState<SamplePreferences>(INITIAL_PREFERENCES);
  const [applied, setApplied] =
    useState<SamplePreferences>(INITIAL_PREFERENCES);
  const [message, setMessage] = useState(
    "The local page sample uses the default preferences.",
  );
  const dirty = !samePreferences(draft, applied);

  useLayoutEffect(() => {
    if (!focusPageAfterApply.current) return;
    focusPageAfterApply.current = false;
    pageTitleRef.current?.focus({ preventScroll: true });
  }, [applied]);

  const groups: readonly TidalSettingsGroup[] = [
    {
      id: "workspace",
      title: "Workspace view",
      description: "Choose how this sample page is arranged.",
      fields: [
        {
          id: "density",
          kind: "select",
          name: "density",
          label: "Navigation density",
          description: "Changes the spacing in the local page sample.",
          value: draft.density,
          options: [
            { value: "comfortable", label: "Comfortable" },
            { value: "compact", label: "Compact" },
          ],
          onValueChange: (value) => {
            setDraft((current) => ({
              ...current,
              density: value as Density,
            }));
            setMessage(
              "Navigation density changed locally. Apply to preview it.",
            );
          },
        },
        {
          id: "start-view",
          kind: "radio",
          name: "startView",
          label: "Start page",
          description: "Select the view shown in the sample page.",
          value: draft.startView,
          required: true,
          options: [
            {
              id: "overview",
              value: "overview",
              label: "Overview",
              description: "Summary and open work",
            },
            {
              id: "activity",
              value: "activity",
              label: "Activity",
              description: "Recent sample changes",
            },
          ],
          onValueChange: (value) => {
            setDraft((current) => ({
              ...current,
              startView: value as StartView,
            }));
            setMessage("Start page changed locally. Apply to preview it.");
          },
        },
      ],
    },
    {
      id: "updates",
      title: "Updates",
      description: "Control one sample communication preference.",
      fields: [
        {
          id: "weekly-digest",
          kind: "toggle",
          name: "weeklyDigest",
          label: "Weekly digest",
          description:
            "Shows whether a fictional digest is included in this preview.",
          checked: draft.weeklyDigest,
          onCheckedChange: (checked) => {
            setDraft((current) => ({
              ...current,
              weeklyDigest: checked,
            }));
            setMessage(
              "Digest preference changed locally. Apply to preview it.",
            );
          },
        },
      ],
    },
  ];

  function applyPreferences(event: React.FormEvent<HTMLFormElement>) {
    event.preventDefault();
    focusPageAfterApply.current = true;
    setApplied(draft);
    setMessage(
      `Local page updated: ${DENSITY_LABELS[draft.density]} spacing, ${VIEW_LABELS[draft.startView]} start page, weekly digest ${draft.weeklyDigest ? "shown" : "hidden"}. Nothing was saved.`,
    );
  }

  function resetPreferences() {
    setDraft(INITIAL_PREFERENCES);
    setApplied(INITIAL_PREFERENCES);
    setMessage(
      "Local preferences reset. No account, workspace, or saved setting changed.",
    );
  }

  return (
    <section
      className="settings-panel-demo"
      aria-label="Settings panel preview"
    >
      <div className="settings-panel-demo-layout">
        <TidalSettingsPanel
          title="Page preferences"
          description="Adjust this local sample, then apply the draft to the page preview below."
          groups={groups}
          onSubmit={applyPreferences}
          onReset={resetPreferences}
          applyButtonProps={{
            name: "intent",
            value: "apply-local-sample",
            disabled: !dirty,
          }}
          summaryProps={{
            role: "status",
            "aria-live": "polite",
            "aria-atomic": true,
          }}
          summary={
            <p>
              {dirty ? "Unapplied local changes. " : ""}
              {message}
            </p>
          }
        />

        <section
          className="settings-panel-demo-page"
          data-density={applied.density}
          aria-labelledby={pageTitleId}
        >
          <header>
            <div>
              <span>LOCAL PAGE SAMPLE</span>
              <h3 id={pageTitleId} ref={pageTitleRef} tabIndex={-1}>
                {VIEW_LABELS[applied.startView]}
              </h3>
            </div>
            <span>{DENSITY_LABELS[applied.density]} spacing</span>
          </header>
          <div className="settings-panel-demo-page-grid">
            <ul aria-label="Sections shown in the local page sample">
              <li data-active={applied.startView === "overview" || undefined}>
                Overview
              </li>
              <li data-active={applied.startView === "activity" || undefined}>
                Activity
              </li>
              <li>Projects</li>
            </ul>
            <div className="settings-panel-demo-page-content">
              <strong>
                {applied.startView === "overview"
                  ? "Three sample priorities"
                  : "Five sample updates"}
              </strong>
              <span>
                Preview content changes only after the native Apply button
                submits locally.
              </span>
            </div>
          </div>
          <footer>
            <span>Weekly digest</span>
            <strong>{applied.weeklyDigest ? "Shown" : "Hidden"}</strong>
          </footer>
        </section>

        <p className="settings-panel-demo-boundary">
          This demo changes only React state in the rendered preview. It makes
          no request, creates no account, and writes no stored preference.
        </p>
      </div>
    </section>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <style>{tidalExampleStyles}</style>
      <SettingsPanelDemo />
    </div>
  );
}

```

## Gotchas

- The host application owns data, validation, persistence, navigation, and service side effects described by this API.

## Theme and accessibility

{"tokens":["--t-accent","--t-border","--t-border-strong","--t-canvas","--t-danger","--t-display","--t-ease-out","--t-ease-spring","--t-faint","--t-font","--t-ink","--t-line","--t-muted","--t-primary","--t-primary-contrast","--t-radius-card","--t-radius-control","--t-radius-overlay","--t-radius-panel","--t-ring","--t-shadow-lg","--t-shadow-soft","--t-soft","--t-subtle","--t-surface","--t-wash"],"darkMode":true}

{"keyboard":["Tab and Shift+Tab follow the component's native focus order.","Arrow-key behavior follows the exported composite-control implementation."],"aria":"The component wires labels and relationships from consumer-provided visible text or ARIA props; preserve those labels in production.","notes":"Verify focus visibility, text alternatives, contrast, and reduced motion in the final composition."}

title and typed groups are required. Groups contain stable ids, consumer-owned headings/descriptions and toggle, native single-select, or native radio fields. Every field has a stable id, name, visible ReactNode label, optional description/disabled state, controlled value, native control attributes/ref, and a value-change callback composed after the native handler unless prevented. Toggle inputs use checkbox plus fixed switch semantics; select fields preserve native option and form behavior; radio fields use native fieldset, legend, required and same-name inputs. The native form forwards attributes/ref including action, method, target, noValidate, onSubmit and onReset. Apply/reset buttons forward native attributes/refs and default to submit/reset while preserving explicit types, form ownership, submitter overrides, names and values. Optional summary/summaryProps, heading level, eyebrow, empty message and root disabled state remain consumer-owned. Consumers own validation, dirty state, apply/reset outcomes, persistence and every side effect. Controlled consumers update visible values in onReset when reset should change state. Group, field and option ids must be unique within an instance. The component makes no request and creates no account or stored setting.
