---
title: Radio Group
description: Single-selection radio groups with individually selectable options.
---

Use radio groups when exactly one option should be selected from a set.

<UiDemo id="radio-group" />

## Installation

<Tabs>
<Tab title="Gradle">
```kotlin title="app/build.gradle.kts"
implementation("com.composables:ui:0.1.0")
```
</Tab>
<Tab title="Copy & Paste">
#### Add the required dependencies

```kotlin title="app/build.gradle.kts"
implementation("com.composables:composeunstyled:2.7.0")
```

#### Copy and paste the following sources into your project

<ComponentSource file="components/RadioGroup.kt" />
<ComponentSource file="components/Utils.kt" />
</Tab>
</Tabs>

## Examples

### Disabled

<UiDemo id="radio-group-disabled" />

## API Reference

### RadioGroup

A single-selection group that coordinates radio options.

```kotlin
@Composable
fun <T> RadioGroup(
    value: T?,
    onValueChange: (T) -> Unit,
    modifier: Modifier = Modifier,
    accessibilityLabel: String? = null,
    content: @Composable () -> Unit,
)
```

| Parameter | Type | Description |
|-----------|------|-------------|
| `value` | `T?` | Currently selected value for the radio group or the value represented by a radio. |
| `onValueChange` | `(T) -> Unit` | Called when the selected value changes. |
| `modifier` | `Modifier` | Modifier applied to the component. |
| `accessibilityLabel` | `String?` | Accessible label announced for the radio group. |
| `content` | `@Composable () -> Unit` | Composable content displayed by the component. |

### Radio

A selectable option inside a RadioGroup.

```kotlin
@Composable
fun <T> Radio(
    value: T,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
    content: (@Composable RowScope.() -> Unit)? = null,
)
```

| Parameter | Type | Description |
|-----------|------|-------------|
| `value` | `T` | Currently selected value for the radio group or the value represented by a radio. |
| `modifier` | `Modifier` | Modifier applied to the component. |
| `enabled` | `Boolean` | Whether the radio option can be interacted with. |
| `interactionSource` | `MutableInteractionSource` | Interaction source used for focus and press state. |
| `content` | `(@Composable RowScope.() -> Unit)?` | Composable content displayed by the component. |

