# OptionGroup

> Priced choices for something being ordered: a group is a fieldset of radios when one pick is required, or of checkboxes up to a limit when the picks are extras, each with what it adds to the price.

```ts
import { OptionGroup } from "@sdxc/ui/commerce";
```

Renders a group: its title, hint and Required badge in the legend, then one row per pick
with its price at the end. Every input carries `data-price`, which OptionsLive sums.

## Examples

```tsx
<OptionGroup name="tortilla" title="Tortilla" hint="Pick one" required requiredLabel="Required" choices={[{ value: "corn", label: "Blue corn", price: 0 }, { value: "flour", label: "Flour", price: 50, priceLabel: "+$0.50" }]} />
```

## Props

| Prop | Type | Description |
| --- | --- | --- |
| `name` | `string` | The field every pick posts as. |
| `title` | `string` |  |
| `hint?` | `string` | A line under the title, such as "Pick one" or "Optional, up to 3". |
| `required?` | `boolean` | Takes exactly one pick, drawn as radios; otherwise checkboxes. |
| `max?` | `number` | How many checkboxes may be ticked; ignored when `required`. @default 1 |
| `choices` | `Choice[]` |  |
| `defaultValue?` | `string[]` | The values ticked at first. |
| `requiredLabel?` | `string` | The badge a required group carries, such as "Required". |

Also accepts everything in `Omit<TagProps<"fieldset">, "children" | "name">`.

