# @leafygreen-ui/radio-group

> leafyGreen UI Kit RadioGroup

Latest version **13.0.13** (published 2026-10-02) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @leafygreen-ui/radio-group
pnpm add @leafygreen-ui/radio-group
yarn add @leafygreen-ui/radio-group
bun add @leafygreen-ui/radio-group
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 13.0.13 |
| Published | 2026-10-02 |
| First published | 2019-04-17 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 6 |
| Unpacked size | 157.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 274 |
| Maintainers | thesonofthomp, shaneeza, stephl3, aitchpgm, hnevins, _tsck |

## Links

- npm: https://www.npmjs.com/package/@leafygreen-ui/radio-group
- Repository: https://github.com/mongodb/leafygreen-ui
- Homepage: https://github.com/mongodb/leafygreen-ui/tree/main/packages/radio-group
- Issues: https://jira.mongodb.org/projects/PD/summary
- npm.io page: https://npm.io/package/@leafygreen-ui/radio-group

## Dependencies (6)

- [@leafygreen-ui/lib](https://npm.io/package/@leafygreen-ui/lib.md) ^15.7.1
- [@leafygreen-ui/hooks](https://npm.io/package/@leafygreen-ui/hooks.md) ^9.3.2
- [@leafygreen-ui/tokens](https://npm.io/package/@leafygreen-ui/tokens.md) ^4.2.3
- [@leafygreen-ui/emotion](https://npm.io/package/@leafygreen-ui/emotion.md) ^5.2.1
- [@leafygreen-ui/palette](https://npm.io/package/@leafygreen-ui/palette.md) ^5.0.3
- [@leafygreen-ui/typography](https://npm.io/package/@leafygreen-ui/typography.md) ^22.2.5

## Recent versions

- 13.0.13 (latest) — 2026-10-02
- 10.1.7 (beta) — 2023-07-26
- 11.0.0-alpha.1 (alpha) — 2023-07-20
- 10.1.4-next.7 (next) — 2023-05-26
- 8.1.0-test.1 (test) — 2022-09-29
- 13.0.12 — 2026-01-21
- 13.0.11 — 2025-11-24
- 13.0.10 — 2025-11-13
- 13.0.9 — 2025-10-31
- 13.0.8 — 2025-10-21
- 13.0.7 — 2025-09-25
- 13.0.6 — 2025-09-10
- 13.0.5 — 2025-09-03
- 13.0.4 — 2025-07-28
- 13.0.3 — 2025-07-03
- … 99 more at https://npm.io/package/@leafygreen-ui/radio-group/versions

## README

# Radio Group

![npm (scoped)](https://img.shields.io/npm/v/@leafygreen-ui/radio-group.svg)

#### [View on MongoDB.design](https://www.mongodb.design/component/radio-group/live-example/)

## Installation

### PNPM

```shell
pnpm add @leafygreen-ui/radio-group
```

### Yarn

```shell
yarn add @leafygreen-ui/radio-group
```

### NPM

```shell
npm install @leafygreen-ui/radio-group
```

## Example

```js
import { Radio, RadioGroup } from '@leafygreen-ui/radio-group';

<RadioGroup
  className="my-radio-group"
  variant="default"
  onChange={event => console.log('hi')}
  value="option-1"
  name="name-of-input-group"
>
  <Radio className="my-radio" value="option-1">
    Label Text Goes Here
  </Radio>
</RadioGroup>;
```

## Properties

| Prop        | Type                               | Description                                                                                                                                                                          | Default    |
| ----------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------- |
| `darkMode`  | `boolean`                          | Determines whether or not the component appears in dark mode                                                                                                                         | `false`    |
| `name`      | `string`                           | Sets the name of the input group                                                                                                                                                     |            |
| `value`     | `string`, `number`                 | Sets the radio that will appear checked on page load, also makes the component a controlled component                                                                                |            |
| `className` | `string`                           | Adds a className to the root element.                                                                                                                                                | `''`       |
| `onChange`  | `function`                         | The event handler function for the 'onchange' event. Receives the associated `event` object as the first argument.                                                                   | `() => {}` |
| `children`  | `node`                             | Can be any node; however, any `<Radio />` components, will be treated as belonging to the `<RadioGroup />` compound component, and will receive internal state from `<RadioGroup />` |            |
| `size`      | `'xsmall'`, `'small'`, `'default'` | Sets the size for the Radios. Use of `xsmall` should be limited to only Charts                                                                                                       | `default`  |

_Any other properties will be spread on the root element._

# Radio

## Example

```js
<Radio className="my-radio" value="option-1" disabled={true}>
  Label Text Goes Here
</Radio>
```

## Properties

| Prop               | Type                      | Description                                                                                               | Default |
| ------------------ | ------------------------- | --------------------------------------------------------------------------------------------------------- | ------- |
| `value` (Required) | `string`, `number`        | Every `<Radio />` needs a value prop.                                                                     |         |
| `className`        | `string`                  | Adds a className to the label                                                                             | `''`    |
| `disabled`         | `boolean`                 | Indicates whether or not the radio can be clicked by a user                                               | `false` |
| `children`         | `node`                    | Text that appears adjacent to the radio input; label text.                                                |         |
| `default`          | `boolean`                 | If `<RadioGroup />` is uncontrolled, the default property makes this Radio checked on the initial render. |         |
| `checked`          | `boolean`                 | Determines if `<Radio />` will appear checked                                                             | `false` |
| ...                | native `input` attributes | Any other props will be spread on the root `input` element                                                |         |

---
_Source: https://npm.io/package/@leafygreen-ui/radio-group · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
