# Radio Group

A set of checkable buttons—where no more than one can be checked at a time.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown variants are available by appending `.md` to any URL or sending an `Accept: text/markdown` header. An agent skill is available at [/.well-known/agent-skills/site-skill.md](/.well-known/agent-skills/site-skill.md).





<ComponentPreview name="radio-group-demo">
  <RadioGroupDemo />
</ComponentPreview>

## Installation [#installation]

<Tabs defaultValue="cli">
  <TabsList>
    <TabsTrigger value="cli">
      CLI
    </TabsTrigger>

    <TabsTrigger value="manual">
      Manual
    </TabsTrigger>
  </TabsList>

  <TabsContent value="cli">
    ```bash
    npx shadcn@latest add https://shadcn-cssinjs.com/r/radio-group.json
    ```
  </TabsContent>

  <TabsContent value="manual">
    <Steps>
      <Step>
        Install the following dependencies:
      </Step>

      ```bash
      pnpm add @base-ui/react @stylexjs/stylex
      ```

      <Step>
        Make sure [StyleX is configured](/docs/installation) and the design tokens are
        installed.
      </Step>

      <Step>
        Copy and paste the following code into your project.
      </Step>

      <ComponentSource name="radio-group" title="radio-group.tsx" />

      <Step>
        Update the import paths to match your project setup.
      </Step>
    </Steps>
  </TabsContent>
</Tabs>

## Usage [#usage]

```tsx
import {
  RadioGroup,
  RadioGroupItem,
} from "@/components/ui/radio-group/radio-group";
```

```tsx
<RadioGroup defaultValue="comfortable">
  <RadioGroupItem value="default" />
  <RadioGroupItem value="comfortable" />
</RadioGroup>
```

## Composition [#composition]

Use the following composition to build a `Radio Group`:

```txt
RadioGroup
├── RadioGroupItem
└── RadioGroupItem
```

## Examples [#examples]



### Description [#description]

<ComponentPreview name="radio-group-description">
  <RadioGroupDescription />
</ComponentPreview>

### Choice Card [#choice-card]

<ComponentPreview name="radio-group-choice-card">
  <RadioGroupChoiceCard />
</ComponentPreview>

### Fieldset [#fieldset]

<ComponentPreview name="radio-group-fieldset">
  <RadioGroupFieldset />
</ComponentPreview>

### Disabled [#disabled]

<ComponentPreview name="radio-group-disabled">
  <RadioGroupDisabled />
</ComponentPreview>

### Invalid [#invalid]

<ComponentPreview name="radio-group-invalid">
  <RadioGroupInvalid />
</ComponentPreview>



## RTL [#rtl]

To enable right-to-left support, see the [RTL guide](/docs/rtl).

<ComponentPreview name="radio-group-rtl" direction="rtl">
  <RadioGroupRtl />
</ComponentPreview>

## API Reference [#api-reference]

See the [Base UI](https://base-ui.com/react/components/radio-group#api-reference) documentation for the full API.
