Radio Button Group
A single-selection button group with card-style radio options, icons, and custom indicators.
Usage
"use client";
import { RadioButtonGroup } from "@thenamespace/uikit";
import { Description } from "@thenamespace/uikit/description";
import { Label } from "@thenamespace/uikit/label";Anatomy
Import the RadioButtonGroup component and access all parts using dot notation.
import { RadioButtonGroup } from "@thenamespace/uikit";
<RadioButtonGroup>
<RadioButtonGroup.Item>
<RadioButtonGroup.ItemIcon />
<RadioButtonGroup.ItemContent />
<RadioButtonGroup.Indicator />
</RadioButtonGroup.Item>
</RadioButtonGroup>;Delivery And Payment
"use client";
import { RadioButtonGroup } from "@thenamespace/uikit";
import { Description } from "@thenamespace/uikit/description";
import { Label } from "@thenamespace/uikit/label";Subscription Plans
"use client";
import { CheckmarkCircle02Icon } from "@thenamespace/uikit/icons";
import { HugeiconsIcon } from "@thenamespace/uikit/icons";
import { RadioButtonGroup } from "@thenamespace/uikit";Controlled
Selected: pro
"use client";
import { useState } from "react";
import { RadioButtonGroup } from "@thenamespace/uikit";Custom Indicator
"use client";
import { CheckmarkCircle02Icon } from "@thenamespace/uikit/icons";
import { HugeiconsIcon } from "@thenamespace/uikit/icons";
import { RadioButtonGroup } from "@thenamespace/uikit";Disabled Group
"use client";
import { RadioButtonGroup } from "@thenamespace/uikit";
import { Description } from "@thenamespace/uikit/description";
import { Label } from "@thenamespace/uikit/label";Grid Layout
"use client";
import { RadioButtonGroup } from "@thenamespace/uikit";
import { Description } from "@thenamespace/uikit/description";
import { Label } from "@thenamespace/uikit/label";Icon Cards
"use client";
import { RadioButtonGroup } from "@thenamespace/uikit";
import { Chip } from "@thenamespace/uikit/chip";
import { Description } from "@thenamespace/uikit/description";No Indicator
"use client";
import { RadioButtonGroup } from "@thenamespace/uikit";
import { Description } from "@thenamespace/uikit/description";
import { Label } from "@thenamespace/uikit/label";Render Prop Children
"use client";
import { RadioButtonGroup } from "@thenamespace/uikit";
import { Description } from "@thenamespace/uikit/description";
import { Label } from "@thenamespace/uikit/label";With Icons
"use client";
import { RadioButtonGroup } from "@thenamespace/uikit";
import { Description } from "@thenamespace/uikit/description";
import { Label } from "@thenamespace/uikit/label";With Ripple
"use client";
import { RadioButtonGroup } from "@thenamespace/uikit";
import { Description } from "@thenamespace/uikit/description";
import { Label } from "@thenamespace/uikit/label";CSS Classes
Base Classes
.radio-button-group- Base RadioGroup container with flex layout
Layout Classes
.radio-button-group--grid- Grid layout mode
Element Classes
.radio-button-group__item- Card-like radio button with border and selection ring.radio-button-group__indicator- Positioned top-right indicator (radio dot or custom icon).radio-button-group__item-content- Text/content area wrapping Radio.Content.radio-button-group__item-icon- Leading icon container
Interactive States
- Selected:
[data-selected="true"]on.radio-button-group__item(accent ring) - Focus visible:
:focus-visibleor[data-focus-visible="true"]on.radio-button-group__item(focus ring) - Disabled:
:disabledor[aria-disabled="true"]on.radio-button-group__item(reduced opacity)
CSS Variables
--radio-button-group-item-radius- Border radius of items (default:var(--radius-2xl))
API Reference
RadioButtonGroup
The root component. Wraps Namespace UIKit RadioGroup with card-style layout.
| Prop | Type | Default | Description |
|---|---|---|---|
layout | 'flex' | 'grid' | 'flex' | Layout mode for items |
Also supports all Namespace UIKit RadioGroup props.
RadioButtonGroup.Item
A selectable card wrapping Namespace UIKit Radio. Supports render prop children for accessing selection state.
Also supports all Namespace UIKit Radio props.
RadioButtonGroup.Indicator
Selection indicator positioned at the top-right of the item.
- No children: renders the default Namespace UIKit radio dot (Control + Indicator)
- With children: renders a custom icon that appears only when selected
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Custom indicator icon (shown when selected) |
Also supports all native span HTML attributes.
RadioButtonGroup.ItemContent
Content area for title and description text. Wraps Namespace UIKit Radio.Content.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Content elements |
Also supports all native div HTML attributes.
RadioButtonGroup.ItemIcon
Leading icon container.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Icon element |
Also supports all native div HTML attributes.