# @gluestack-ui/radio

> A universal headless Radio component for React Native, Next.js & React

Latest version **0.1.40** (published 2025-03-11) · 0 weekly downloads

## Install

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

## Health

**Score 50/100 (C)** — status: stable.

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

Warnings: low downloads; pre 1.0.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 0.1.40 |
| Published | 2025-03-11 |
| First published | 2023-02-21 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 7 |
| Unpacked size | 48 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5308 |
| Maintainers | vidhi499, rohit_singh, viraj-10, rayan1810, rajat693, surajahmedc, meenumakkar, madhavb230100, vaibhk002, daminipandey, amars29, geekgautam, sravankumarvelangi, gluestackadmin, geekashwini, mayankp06 |
| Keywords | react, native, react-native, radio, gluestack-ui, universal, headless, typescript, component, android, ios, nextjs |

## Links

- npm: https://www.npmjs.com/package/@gluestack-ui/radio
- Repository: https://github.com/gluestack/gluestack-ui
- Homepage: https://github.com/gluestack/gluestack-ui/tree/main/packages/unstyled/radio#readme
- Issues: https://github.com/gluestack/gluestack-ui/issues
- npm.io page: https://npm.io/package/@gluestack-ui/radio

## Dependencies (7)

- [@gluestack-ui/utils](https://npm.io/package/@gluestack-ui/utils.md) ^0.1.15
- [@react-stately/radio](https://npm.io/package/@react-stately/radio.md) ^3.8.1
- [@react-native-aria/focus](https://npm.io/package/@react-native-aria/focus.md) ^0.2.9
- [@react-native-aria/radio](https://npm.io/package/@react-native-aria/radio.md) ^0.2.13
- [@gluestack-ui/form-control](https://npm.io/package/@gluestack-ui/form-control.md) ^0.1.19
- [@react-aria/visually-hidden](https://npm.io/package/@react-aria/visually-hidden.md) ^3.7.0
- [@react-native-aria/interactions](https://npm.io/package/@react-native-aria/interactions.md) 0.2.16

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.40 (latest) — 2025-03-11
- 0.1.39 — 2025-03-03
- 0.1.38 — 2025-02-19
- 0.1.37 — 2025-02-18
- 0.1.36 — 2025-02-18
- 0.1.35 — 2025-02-18
- 0.1.34 — 2024-11-11
- 0.1.33 — 2024-09-03
- 0.1.32 — 2024-08-27
- 0.1.31 — 2024-07-08
- 0.1.30 — 2024-07-02
- 0.1.29 — 2024-04-03
- 0.1.28 — 2024-04-03
- 0.1.27 — 2024-03-21
- 0.1.26 — 2024-03-18
- … 27 more at https://npm.io/package/@gluestack-ui/radio/versions

## README

# @gluestack-ui/radio

## Installation

To use `@gluestack-ui/radio`, all you need to do is install the
`@gluestack-ui/radio` package:

```sh
$ yarn add @gluestack-ui/radio

# or

$ npm i @gluestack-ui/radio
```

## Usage

The Radio component presents users with predefined choices and enables them to select only one option. It is commonly used for providing a single-choice selection in forms or surveys. Here's an example how to use this package to create one:

```jsx
import { Root, Group, Icon, Indicator, Label } from './styled-components';
import { createRadio } from '@gluestack-ui/radio';

export const Radio = createRadio({
  Root,
  Group,
  Icon,
  Indicator,
  Label,
});
```

## Customizing the Radio:

Default styling of all these components can be found in the components/core/radio file. For reference, you can view the [source code](https://github.com/gluestack/gluestack-ui/blob/development/example/storybook/src/ui-components/Radio/index.tsx) of the styled `Radio` components.

```jsx
// import the styles
import {
  Root,
  Indicator,
  Icon,
  Label,
  Group,
} from '../components/core/radio/styled-components';

// import the createRadio function
import { createRadio } from '@gluestack-ui/radio';

// Understanding the API
const Radio = createRadio({
  Root,
  Indicator,
  Icon,
  Label,
  Group,
});

// Using the radio component
export default () => (
  <RadioGroup>
    <Radio>
      <RadioIndicator>
        <RadioIcon as={CircleIcon} />
      </RadioIndicator>
      <RadioLabel />
    </Radio>
  </RadioGroup>
);
```

More guides on how to get started are available
[here](https://ui.gluestack.io/docs/components/forms/radio).

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