# ToggleGroup

Optional single or multiple selections exposed as pressed buttons.

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, ToggleGroup } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <ToggleGroup label="Text formatting" defaultValue={["bold"]} options={[{value: "bold", label: "Bold"}, {value: "italic", label: "Italic"}]} />
    </FloodRoot>
  );
}
```

## Design notes

- Tab reaches each enabled action. Arrows/Home/End move focus without selecting. Single selection can be cleared.
- Use RadioGroup for form choices and tabs for switching panels. ToggleGroup does not submit form values.

## API reference

| Prop | Values | Default |
| --- | --- | --- |
| `label` | `string` | `Required` |
| `options` | `readonly ToggleOption[]` | `Required` |
| `selectionMode` | `"single" \| "multiple"` | `"multiple"` |
| `value` | `readonly string[]` | `—` |
| `defaultValue` | `readonly string[]` | `[]` |
| `onValueChange` | `(value: string[]) => void` | `—` |
| `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` |
| `size` | `"2xs" \| "xs" \| "sm" \| "md" \| "lg" \| "xl" \| "2xl"` | `"md"` |
| `variant` | `"solid" \| "subtle" \| "outline" \| "ghost"` | `"subtle"` |
| `disabled` | `boolean` | `false` |
| `iconOnly` | `boolean` | `false` |
| `Native HTML props` | `Omit<HTMLAttributes<HTMLDivElement>, "role" \| "children" \| "defaultValue" \| "onChange">` | `Forwarded` |
