# @salmonui/inputs/radio-group API reference

> 6 exported symbols of @salmonui/inputs/radio-group: 2 components, 2 interfaces and 2 types.

Canonical: https://salmonui.dev/docs/reference/inputs/radio-group

```ts
import { … } from '@salmonui/inputs/radio-group';
```

## Components

### Radio

Kind: component

Page: https://salmonui.dev/docs/reference/inputs/radio-group/Radio

```ts
function Radio(props: RadioProps): ReactNode;
```

One radio. Inside a `RadioGroup` it
takes the group's name and selection; outside it is a plain native radio
grouped by its own `name` (`checked` / `defaultChecked` are native).

Props: [`RadioProps`](https://salmonui.dev/docs/reference/inputs/radio-group/RadioProps) (its members are the props)

### RadioGroup

Kind: component

Page: https://salmonui.dev/docs/reference/inputs/radio-group/RadioGroup

```ts
function RadioGroup(props: RadioGroupProps): ReactNode;
```

Radio group: a `<fieldset role="radiogroup">` named by
`label` around native radios that share one `name`, so the browser
provides the single Tab stop and arrow-key selection.

Props: [`RadioGroupProps`](https://salmonui.dev/docs/reference/inputs/radio-group/RadioGroupProps) (its members are the props)

## Interfaces

### RadioGroupProps

Kind: interface

Page: https://salmonui.dev/docs/reference/inputs/radio-group/RadioGroupProps

```ts
interface RadioGroupProps extends FieldCommonProps {
    readonly value?: string | null | undefined;
    readonly defaultValue?: string | null | undefined;
    readonly onValueChange?: ((value: string, details: RadioChangeDetails) => void) | undefined;
    readonly name?: string | undefined;
    readonly form?: string | undefined;
    readonly required?: boolean | undefined;
    readonly disabled?: boolean | undefined;
    readonly readOnly?: boolean | undefined;
    readonly orientation?: 'vertical' | 'horizontal' | undefined;
    readonly labelPlacement?: LabelPlacement | undefined;
    readonly localeText?: FieldValidationText | undefined;
    readonly id?: string | undefined;
    readonly dir?: 'ltr' | 'rtl' | 'auto' | undefined;
    readonly children?: ReactNode;
    readonly className?: string | undefined;
    readonly style?: CSSProperties | undefined;
    readonly classNames?: {
        readonly label?: string;
        readonly items?: string;
        readonly description?: string;
        readonly error?: string;
    } | undefined;
    readonly ref?: Ref<HTMLFieldSetElement> | undefined;
}
```

Members (25):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `value` | `readonly value?: string \| null \| undefined;` | optional | Selected value; `null` selects nothing. |
| `defaultValue` | `readonly defaultValue?: string \| null \| undefined;` | optional |  |
| `onValueChange` | `readonly onValueChange?: ((value: string, details: RadioChangeDetails) => void) \| undefined;` | optional |  |
| `name` | `readonly name?: string \| undefined;` | optional | Submitted name. Without it the radios share a generated name and are not submitted. |
| `form` | `readonly form?: string \| undefined;` | optional |  |
| `required` | `readonly required?: boolean \| undefined;` | optional |  |
| `disabled` | `readonly disabled?: boolean \| undefined;` | optional |  |
| `readOnly` | `readonly readOnly?: boolean \| undefined;` | optional | Radios ignore changes but stay focusable (`aria-readonly`). |
| `orientation` | `readonly orientation?: 'vertical' \| 'horizontal' \| undefined;` | optional |  |
| `labelPlacement` | `readonly labelPlacement?: LabelPlacement \| undefined;` | optional | Label placement of every radio. Default `'end'`. |
| `localeText` | `readonly localeText?: FieldValidationText \| undefined;` | optional |  |
| `id` | `readonly id?: string \| undefined;` | optional |  |
| `dir` | `readonly dir?: 'ltr' \| 'rtl' \| 'auto' \| undefined;` | optional |  |
| `children` | `readonly children?: ReactNode;` | optional |  |
| `className` | `readonly className?: string \| undefined;` | optional |  |
| `style` | `readonly style?: CSSProperties \| undefined;` | optional |  |
| `classNames` | `readonly classNames?: {     readonly label?: string;     readonly items?: string;     readonly description?: string;     readonly error?: string; } \| undefined;` | optional | Part classes: `root` is `className`; `label` (legend), `items`, `description`, `error`. |
| `ref` | `readonly ref?: Ref<HTMLFieldSetElement> \| undefined;` | optional | The `<fieldset role="radiogroup">`. |
| `label` | `label?: ReactNode;` | optional, inherited |  |
| `description` | `description?: ReactNode;` | optional, inherited |  |
| `errorMessage` | `errorMessage?: ((ctx: { readonly errors: readonly string[]; }) => ReactNode) \| ReactNode;` | optional, inherited | Error text (or a function of the errors) shown while the field is invalid. |
| `invalid` | `invalid?: boolean;` | optional, inherited | Forces the error state. |
| `validation` | `validation?: FieldValidation;` | optional, inherited | Rules in the Data Grid vocabulary. |
| `validateOn` | `validateOn?: ValidateOn;` | optional, inherited | When errors appear; default the `Form`'s, else `'blur'`. |
| `size` | `size?: FieldSize;` | optional, inherited | Metric set. Default `'md'`. |

### RadioProps

Kind: interface

Page: https://salmonui.dev/docs/reference/inputs/radio-group/RadioProps

```ts
interface RadioProps extends NativeRadio {
    readonly value: string;
    readonly children?: ReactNode;
    readonly labelPlacement?: LabelPlacement | undefined;
    readonly className?: string | undefined;
    readonly style?: CSSProperties | undefined;
    readonly classNames?: {
        readonly input?: string;
        readonly label?: string;
    } | undefined;
    readonly ref?: Ref<HTMLInputElement> | undefined;
}
```

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `value` | `readonly value: string;` |  | The value this radio selects. |
| `children` | `readonly children?: ReactNode;` | optional | Label text. |
| `labelPlacement` | `readonly labelPlacement?: LabelPlacement \| undefined;` | optional |  |
| `className` | `readonly className?: string \| undefined;` | optional |  |
| `style` | `readonly style?: CSSProperties \| undefined;` | optional |  |
| `classNames` | `readonly classNames?: {     readonly input?: string;     readonly label?: string; } \| undefined;` | optional |  |
| `ref` | `readonly ref?: Ref<HTMLInputElement> \| undefined;` | optional | The native `<input type="radio">`. |

## Types

### RadioChangeDetails

Kind: type

Page: https://salmonui.dev/docs/reference/inputs/radio-group/RadioChangeDetails

```ts
type RadioChangeDetails = ChoiceChangeDetails<'select' | 'reset'>;
```

Second argument of `onValueChange`: `reason` is `'select'` (click, arrow keys, Space) or `'reset'` (form reset).

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `source` | `source: "api" \| PressSource;` | inherited |  |
| `reason` | `reason: "reset" \| "select";` | inherited |  |

## Re-exported entry points

- [@salmonui/inputs/checkbox](https://salmonui.dev/docs/reference/inputs/checkbox.md): 1 symbol: 1 type
  `LabelPlacement`
