# @berlitz/radio

> Radio component for the Max Design System

Latest version **2.4.3** (published 2025-04-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install @berlitz/radio
pnpm add @berlitz/radio
yarn add @berlitz/radio
bun add @berlitz/radio
```

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.4.3 |
| Published | 2025-04-21 |
| First published | 2019-09-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 36.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | berlitz |

## Links

- npm: https://www.npmjs.com/package/@berlitz/radio
- Homepage: https://github.com/berlitz-global/max/blob/master/components/radio/CHANGELOG.md
- npm.io page: https://npm.io/package/@berlitz/radio

## Dependencies (1)

- [styled-components-rtl](https://npm.io/package/styled-components-rtl.md) 5.2.0

## Recent versions

- 2.4.3 (latest) — 2025-04-21
- 2.2.1-test.0 (canary) — 2022-01-24
- 2.4.2 — 2025-04-16
- 2.4.1 — 2025-04-16
- 2.4.0 — 2025-04-16
- 2.3.1 — 2024-05-30
- 2.3.0 — 2022-10-20
- 2.2.1 — 2022-01-25
- 2.2.0 — 2022-01-12
- 2.1.5 — 2021-09-20
- 2.1.4 — 2021-08-05
- 2.1.3 — 2021-04-09
- 2.1.2 — 2021-02-12
- 1.0.1-alpha.63 — 2021-02-12
- 2.1.1 — 2021-01-21
- … 13 more at https://npm.io/package/@berlitz/radio/versions

## README

# Radio [![npm version](https://img.shields.io/npm/v/@berlitz/radio.svg)](https://www.npmjs.com/package/@berlitz/radio)

Radio button input field

## Installation

```shell
yarn add @berlitz/radio
```

## Props

## Radio.propTypes

| Argument | Type   | Required | Default | Example |
| -------- | ------ | -------- | ------- | ------- |
| Name     | string | No       | No      |         |
| value    | string | No       | No      |         |
| disabled | bool   | No       | false   |         |
| required | bool   | No       | false   |         |
| children | node   | ✅       | No      |         |

## Group.propTypes

| Argument  | Type                | Required | Default | Example |
| --------- | ------------------- | -------- | ------- | ------- |
| name      | string              | No       | No      |         |
| value     | string,number, bool | No       | No      |         |
| children  | node                | ✅       | No      |         |
| onChange  | func                | No       | No      |         |
| fullWidth | bool                | No       | No      |         |

## RadioController Proptypes

| Argument      | Type                | Required | Default | Example |
| ------------- | ------------------- | -------- | ------- | ------- |
| name          | string              | ✅       | No      |         |
| value         | string,number, bool | No       | No      |         |
| disabled      | bool                | No       | false   |         |
| required      | bool                | No       | false   |         |
| data          | func                | ✅       | No      |         |
| setFieldValue | bool                | ✅       | No      |         |

## Usage

`yarn add @berlitz/radio`

```jsx
import { RadioController } from '@berlitz/radio'

const data = [
  {
    id: 'value 1',
    name: 'radio label 1'
  },
  {
    id: 'value 2',
    name: 'radio label 2'
  },
  {
    id: 'value 3',
    name: 'radio  label 3'
  },
]

<RadioController name='my_radio_field' data={data} value='value 2' setFieldValue={() => {}} disabled />

```

### When to use this component

Any input field that requires radio button

### Notes

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