# SettingGroup

A named section of settings with shared row spacing.

Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.

## Example

```tsx
"use client";

import { FloodRoot, SettingGroup, Switch, SettingRow, Link } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <SettingGroup title="Notifications"><Switch layout="row" label="Weekly summary" /><SettingRow label="Delivery history" action={<Link href="/notifications">View history</Link>} /></SettingGroup>
    </FloodRoot>
  );
}
```

## Design notes

- Compose SettingRow for actions, row-layout Switch for on/off values, and Field layout=adaptive for editable scalar settings. Use Fieldset when controls share a form legend or validation boundary.
- Choose layout=aligned in a mixed settings panel when direct adaptive Fields and SettingRows should share the same columns and stack at the same group width. Row-layout switches keep their trailing position.
- Choose headingLevel for the surrounding page. Use spacing to separate rows by default. Enable dividers when dense adjacent items are hard to distinguish.

## API reference

| Prop | Values | Default |
| --- | --- | --- |
| `title` | `string` | `Required` |
| `description` | `ReactNode` | `—` |
| `actions` | `ReactNode` | `—` |
| `headingLevel` | `2 \| 3 \| 4 \| 5 \| 6` | `—` |
| `headingSize` | `HeadingProps["size"]` | `"group"` |
| `density` | `"compact" \| "comfortable"` | `"comfortable"` |
| `dividers` | `boolean` | `false` |
| `layout` | `"adaptive" \| "aligned"` | `"adaptive"` |
| `Native HTML props` | `Omit<HTMLAttributes<HTMLElement>, "title">` | `Forwarded` |
