---
title: Checkbox
description: Checkbox controls for independent on and off selections.
---

Use checkboxes when people can enable or disable options independently.

<UiDemo id="checkbox" />

## 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/Checkbox.kt" />
<ComponentSource file="components/Utils.kt" />
</Tab>
</Tabs>

## Examples

### Disabled

<UiDemo id="checkbox-disabled" />

### Hierarchical selection

For parent and child selection flows, use the tri-state checkbox variant.

See [Tri-State Checkbox](tri-state-checkbox.md).

## API Reference

### Checkbox

A checkbox for independent binary selections.

```kotlin
@Composable
fun Checkbox(
    checked: Boolean,
    onCheckedChange: (Boolean) -> Unit,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    accessibilityLabel: String? = null,
    interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
    content: (@Composable RowScope.() -> Unit)? = null,
)
```

| Parameter | Type | Description |
|-----------|------|-------------|
| `checked` | `Boolean` | Whether the checkbox is currently checked. |
| `onCheckedChange` | `(Boolean) -> Unit` | Called when the checked state changes. |
| `modifier` | `Modifier` | Modifier applied to the checkbox row. |
| `enabled` | `Boolean` | Whether the checkbox can be interacted with. |
| `accessibilityLabel` | `String?` | Accessible label announced for the checkbox. |
| `interactionSource` | `MutableInteractionSource` | Interaction source used for focus and press state. |
| `content` | `(@Composable RowScope.() -> Unit)?` | Optional label or supporting content displayed next to the checkbox. |

