# SegmentedControl

A compact single-value choice with native radio semantics and a shared inset surface.

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

export function Example() {
  return (
    <FloodRoot>
      <SegmentedControl label="Time range" name="period" defaultValue="day" options={[{value: "day", label: "Day"}, {value: "week", label: "Week"}, {value: "month", label: "Month"}]} />
    </FloodRoot>
  );
}
```

## Design notes

- Uses original RadioGroup behavior and native inputs.
- Arrow keys move focus and select; Home/End select endpoints, skipping disabled segments. Selecting the current value does not clear it.
- Native name/form/required, reset and controlled values are preserved. Use actual tabs for tab panels, ToggleGroup for optional pressed actions.

## API reference

| Prop | Values | Default |
| --- | --- | --- |
| `legendSize · 0.2.10` | `"label" \| "section"` | `—` |
| `hideLabel · 0.2.3` | `boolean` | `—` |
| `hint` | `ReactNode` | `—` |
| `error` | `ReactNode` | `—` |
| `message` | `ReactNode` | `—` |
| `status` | `"error" \| "warning" \| "success" \| "info"` | `—` |
| `name` | `string` | `Required` |
| `value` | `string` | `—` |
| `defaultValue` | `string` | `—` |
| `onValueChange` | `(value: string) => void` | `—` |
| `orientation` | `"vertical" \| "horizontal"` | `"horizontal"` |
| `required` | `boolean` | `—` |
| `label` | `string` | `Required` |
| `options` | `readonly ToggleOption[]` | `Required` |
| `controlSize` | `"sm" \| "md" \| "lg" \| "xl"` | `"md"` |
| `iconOnly` | `boolean` | `false` |
| `fullWidth` | `boolean` | `false` |
| `Native HTML props` | `Omit<Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, "children" \| "defaultValue" \| "role">, "legend" \| "options">` | `Forwarded` |
