# RadioGroup

Lets users choose one option from a mutually exclusive set. Use it when all available choices should remain visible.

Package: `@kela-systems/ui-components` 4.1.0

```tsx
import { RadioGroup, RadioGroupItem } from "@kela-systems/ui-components";
```

Links (Kela sign-in needed): [Storybook](https://main--6af1efd9453270bb59a6c00c.chromatic.com/?path=/docs/components-radiogroup--docs), [Source](https://github.com/Kela-Systems/kela/tree/main/packages/next/ui-components/src/radio-group), [Figma](https://www.figma.com/design/anhlwrbFM6mUiL0klxeK1I/ARK---Design-System?node-id=64-316)

## Examples

### Default

```tsx
import {
  Field,
  FieldContent,
  FieldDescription,
  FieldLabel,
  RadioGroup,
  RadioGroupItem,
} from "@kela-systems/ui-components";

const actions = [
  { value: "dock", label: "Return to dock", description: "Fly the shortest safe route home." },
  { value: "hover", label: "Hover in place", description: "Hold position until told otherwise." },
  { value: "land", label: "Land now", description: "Descend at the current position." },
];

export default function RadioGroupDefault() {
  return (
    <RadioGroup aria-label="On signal loss" defaultValue="dock" className="w-full max-w-xs">
      {actions.map((action) => (
        <Field key={action.value} orientation="horizontal">
          <RadioGroupItem id={`action-${action.value}`} value={action.value} />
          <FieldContent>
            <FieldLabel htmlFor={`action-${action.value}`}>{action.label}</FieldLabel>
            <FieldDescription>{action.description}</FieldDescription>
          </FieldContent>
        </Field>
      ))}
    </RadioGroup>
  );
}
```

## Props

A `className` on a part adds layout only: placement, sizing and spacing. Pick a look with a variant.

### RadioGroup

Also takes the props of `@base-ui/react/radio-group`.

### RadioGroupItem

Also takes the props of `@base-ui/react/radio`.
