> ## Documentation Index
> Fetch the complete documentation index at: https://araf.badr.co.id/llms.txt
> Use this file to discover all available pages before exploring further.

# Radio Group

> A set of mutually exclusive options where exactly one can be selected at a time — supports vertical, horizontal, and described layouts.

## Overview

<div style={{display:"flex",gap:"32px",flexWrap:"wrap",padding:"28px 24px",background:"#f9fafb",borderRadius:"12px",border:"1px solid #e5e7eb",alignItems:"flex-start"}}>
  <div style={{display:"flex",flexDirection:"column",gap:"10px"}}>
    <div style={{display:"flex",alignItems:"center",gap:"10px"}}>
      <div style={{width:"18px",height:"18px",borderRadius:"50%",border:"1.5px solid #0479CE",background:"#0479CE",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}}>
        <div style={{width:"6px",height:"6px",borderRadius:"50%",background:"#fff"}} />
      </div>

      <span style={{fontSize:"14px",fontWeight:500,color:"#344054",fontFamily:"Inter,sans-serif"}}>Administrator</span>
    </div>

    <div style={{display:"flex",alignItems:"center",gap:"10px"}}>
      <div style={{width:"18px",height:"18px",borderRadius:"50%",border:"1.5px solid #D0D5DD",background:"#fff",flexShrink:0}} />

      <span style={{fontSize:"14px",fontWeight:500,color:"#344054",fontFamily:"Inter,sans-serif"}}>Editor</span>
    </div>

    <div style={{display:"flex",alignItems:"center",gap:"10px"}}>
      <div style={{width:"18px",height:"18px",borderRadius:"50%",border:"1.5px solid #D0D5DD",background:"#fff",flexShrink:0}} />

      <span style={{fontSize:"14px",fontWeight:500,color:"#344054",fontFamily:"Inter,sans-serif"}}>Viewer</span>
    </div>

    <div style={{display:"flex",alignItems:"center",gap:"10px",opacity:0.5,cursor:"not-allowed"}}>
      <div style={{width:"18px",height:"18px",borderRadius:"50%",border:"1.5px solid #D0D5DD",background:"#F9FAFB",flexShrink:0}} />

      <span style={{fontSize:"14px",fontWeight:500,color:"#344054",fontFamily:"Inter,sans-serif"}}>Enterprise (disabled)</span>
    </div>
  </div>

  <div style={{display:"flex",gap:"20px"}}>
    <div style={{display:"flex",alignItems:"center",gap:"10px"}}>
      <div style={{width:"18px",height:"18px",borderRadius:"50%",border:"1.5px solid #D0D5DD",background:"#fff",flexShrink:0}} />

      <span style={{fontSize:"14px",fontWeight:500,color:"#344054",fontFamily:"Inter,sans-serif"}}>Monthly</span>
    </div>

    <div style={{display:"flex",alignItems:"center",gap:"10px"}}>
      <div style={{width:"18px",height:"18px",borderRadius:"50%",border:"1.5px solid #0479CE",background:"#0479CE",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}}>
        <div style={{width:"6px",height:"6px",borderRadius:"50%",background:"#fff"}} />
      </div>

      <span style={{fontSize:"14px",fontWeight:500,color:"#344054",fontFamily:"Inter,sans-serif"}}>Yearly</span>
    </div>
  </div>
</div>

**Radio Group** is used when users must choose exactly one option from a list. Selecting one radio deselects all others. Unlike a Select, all options are visible simultaneously.

***

## Installation

<CodeGroup>
  ```bash npm theme={null}
  npm install @araf-ds/core
  ```

  ```bash yarn theme={null}
  yarn add @araf-ds/core
  ```

  ```bash pnpm theme={null}
  pnpm add @araf-ds/core
  ```
</CodeGroup>

***

## Usage

```tsx theme={null}
import { RadioGroup, RadioGroupItem } from "@araf-ds/core"

export default function Example() {
  return (
    <RadioGroup defaultValue="editor" label="Select role">
      <RadioGroupItem value="admin" label="Administrator" />
      <RadioGroupItem value="editor" label="Editor" />
      <RadioGroupItem value="viewer" label="Viewer" />
    </RadioGroup>
  )
}
```

***

## Variants

### Vertical (Default)

<div style={{padding:"24px",background:"#f9fafb",borderRadius:"12px",border:"1px solid #e5e7eb"}}>
  <div style={{display:"flex",flexDirection:"column",gap:"4px",marginBottom:"8px"}}>
    <span style={{fontSize:"13px",fontWeight:500,color:"#344054",fontFamily:"Inter,sans-serif"}}>Select role</span>
  </div>

  <div style={{display:"flex",flexDirection:"column",gap:"10px"}}>
    <div style={{display:"flex",alignItems:"center",gap:"10px"}}>
      <div style={{width:"18px",height:"18px",borderRadius:"50%",border:"1.5px solid #D0D5DD",background:"#fff",flexShrink:0}} />

      <span style={{fontSize:"14px",color:"#344054",fontFamily:"Inter,sans-serif"}}>Administrator</span>
    </div>

    <div style={{display:"flex",alignItems:"center",gap:"10px"}}>
      <div style={{width:"18px",height:"18px",borderRadius:"50%",border:"1.5px solid #0479CE",background:"#0479CE",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}}>
        <div style={{width:"6px",height:"6px",borderRadius:"50%",background:"#fff"}} />
      </div>

      <span style={{fontSize:"14px",color:"#344054",fontFamily:"Inter,sans-serif"}}>Editor</span>
    </div>

    <div style={{display:"flex",alignItems:"center",gap:"10px"}}>
      <div style={{width:"18px",height:"18px",borderRadius:"50%",border:"1.5px solid #D0D5DD",background:"#fff",flexShrink:0}} />

      <span style={{fontSize:"14px",color:"#344054",fontFamily:"Inter,sans-serif"}}>Viewer</span>
    </div>
  </div>
</div>

```tsx theme={null}
<RadioGroup defaultValue="editor" label="Select role">
  <RadioGroupItem value="admin" label="Administrator" />
  <RadioGroupItem value="editor" label="Editor" />
  <RadioGroupItem value="viewer" label="Viewer" />
</RadioGroup>
```

### Horizontal

<div style={{padding:"24px",background:"#f9fafb",borderRadius:"12px",border:"1px solid #e5e7eb"}}>
  <div style={{display:"flex",gap:"20px",alignItems:"center"}}>
    <div style={{display:"flex",alignItems:"center",gap:"8px"}}>
      <div style={{width:"18px",height:"18px",borderRadius:"50%",border:"1.5px solid #0479CE",background:"#0479CE",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}}>
        <div style={{width:"6px",height:"6px",borderRadius:"50%",background:"#fff"}} />
      </div>

      <span style={{fontSize:"14px",color:"#344054",fontFamily:"Inter,sans-serif"}}>Monthly</span>
    </div>

    <div style={{display:"flex",alignItems:"center",gap:"8px"}}>
      <div style={{width:"18px",height:"18px",borderRadius:"50%",border:"1.5px solid #D0D5DD",background:"#fff",flexShrink:0}} />

      <span style={{fontSize:"14px",color:"#344054",fontFamily:"Inter,sans-serif"}}>Yearly</span>
    </div>
  </div>
</div>

```tsx theme={null}
<RadioGroup orientation="horizontal" defaultValue="monthly">
  <RadioGroupItem value="monthly" label="Monthly" />
  <RadioGroupItem value="yearly" label="Yearly" />
</RadioGroup>
```

### With Descriptions

<div style={{padding:"24px",background:"#f9fafb",borderRadius:"12px",border:"1px solid #e5e7eb"}}>
  <div style={{display:"flex",flexDirection:"column",gap:"12px"}}>
    <div style={{display:"flex",alignItems:"flex-start",gap:"10px"}}>
      <div style={{width:"18px",height:"18px",borderRadius:"50%",border:"1.5px solid #0479CE",background:"#0479CE",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:"2px"}}>
        <div style={{width:"6px",height:"6px",borderRadius:"50%",background:"#fff"}} />
      </div>

      <div>
        <div style={{fontSize:"14px",fontWeight:500,color:"#344054",fontFamily:"Inter,sans-serif"}}>All notifications</div>
        <div style={{fontSize:"13px",color:"#667085",fontFamily:"Inter,sans-serif",marginTop:"2px"}}>Receive all emails and push notifications</div>
      </div>
    </div>

    <div style={{display:"flex",alignItems:"flex-start",gap:"10px"}}>
      <div style={{width:"18px",height:"18px",borderRadius:"50%",border:"1.5px solid #D0D5DD",background:"#fff",flexShrink:0,marginTop:"2px"}} />

      <div>
        <div style={{fontSize:"14px",fontWeight:500,color:"#344054",fontFamily:"Inter,sans-serif"}}>Important only</div>
        <div style={{fontSize:"13px",color:"#667085",fontFamily:"Inter,sans-serif",marginTop:"2px"}}>Only critical alerts and mentions</div>
      </div>
    </div>

    <div style={{display:"flex",alignItems:"flex-start",gap:"10px"}}>
      <div style={{width:"18px",height:"18px",borderRadius:"50%",border:"1.5px solid #D0D5DD",background:"#fff",flexShrink:0,marginTop:"2px"}} />

      <div>
        <div style={{fontSize:"14px",fontWeight:500,color:"#344054",fontFamily:"Inter,sans-serif"}}>None</div>
        <div style={{fontSize:"13px",color:"#667085",fontFamily:"Inter,sans-serif",marginTop:"2px"}}>No notifications</div>
      </div>
    </div>
  </div>
</div>

```tsx theme={null}
<RadioGroup label="Notification preference">
  <RadioGroupItem
    value="all"
    label="All notifications"
    description="Receive all emails and push notifications"
  />
  <RadioGroupItem
    value="important"
    label="Important only"
    description="Only critical alerts and mentions"
  />
  <RadioGroupItem value="none" label="None" description="No notifications" />
</RadioGroup>
```

***

## API Reference

### RadioGroup

<ParamField path="value" type="string">
  Controlled selected value.
</ParamField>

<ParamField path="onValueChange" type="(value: string) => void">
  Callback fired when the selected value changes.
</ParamField>

<ParamField path="defaultValue" type="string">
  Uncontrolled default selected value.
</ParamField>

<ParamField path="orientation" type="string" default="vertical">
  Layout direction. Values: `vertical` · `horizontal`
</ParamField>

<ParamField path="label" type="string">
  Group label displayed above all options.
</ParamField>

<ParamField path="disabled" type="boolean" default="false">
  Disables all items in the group.
</ParamField>

### RadioGroupItem

<ParamField path="value" type="string">
  The option value (required).
</ParamField>

<ParamField path="label" type="string">
  Option label text.
</ParamField>

<ParamField path="description" type="string">
  Supporting description shown below the label.
</ParamField>

<ParamField path="disabled" type="boolean" default="false">
  Disables this specific option.
</ParamField>

***

## Accessibility

* Radio Group uses `role="radiogroup"` with individual `role="radio"` elements
* Arrow keys move between options within the group
* Only one item is in the tab order at a time (roving tabindex pattern)
* Disabled items use `aria-disabled="true"` and are skipped by keyboard navigation
* Group label is associated via `aria-labelledby`
* `description` is linked via `aria-describedby`

***

## Do's & Don'ts

<CardGroup cols={2}>
  <Card title="Do" icon="check" iconType="solid" color="#16A34A">
    * Use Radio Group for mutually exclusive choices (2–6 options)
    * Always include a group label to describe what is being chosen
    * Use horizontal layout for binary choices (Monthly/Yearly)
    * Add descriptions to clarify the implications of each option
  </Card>

  <Card title="Don't" icon="xmark" iconType="solid" color="#DC2626">
    * Don't use Radio Group for more than 6 options — use Select instead
    * Don't use Radio Group for multi-select — use Checkbox Group instead
    * Don't pre-select an option unless there is a clear default
    * Don't disable all options simultaneously — show an empty state instead
  </Card>
</CardGroup>
