Radio Button Group

A single-selection button group with card-style radio options, icons, and custom indicators.

Usage

Select a planChoose the plan that suits your needs
"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

Delivery method
Payment method
"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

Select a planChoose the plan that suits your needs

Selected: pro

"use client";

import { useState } from "react";

import { RadioButtonGroup } from "@thenamespace/uikit";

Custom Indicator

Select a mailing list
"use client";

import { CheckmarkCircle02Icon } from "@thenamespace/uikit/icons";
import { HugeiconsIcon } from "@thenamespace/uikit/icons";
import { RadioButtonGroup } from "@thenamespace/uikit";

Disabled Group

Select a planPlan changes are temporarily unavailable.
"use client";

import { RadioButtonGroup } from "@thenamespace/uikit";
import { Description } from "@thenamespace/uikit/description";
import { Label } from "@thenamespace/uikit/label";

Grid Layout

Delivery method
"use client";

import { RadioButtonGroup } from "@thenamespace/uikit";
import { Description } from "@thenamespace/uikit/description";
import { Label } from "@thenamespace/uikit/label";

Icon Cards

Choose your workspace plan
"use client";

import { RadioButtonGroup } from "@thenamespace/uikit";
import { Chip } from "@thenamespace/uikit/chip";
import { Description } from "@thenamespace/uikit/description";

No Indicator

Select a plan
"use client";

import { RadioButtonGroup } from "@thenamespace/uikit";
import { Description } from "@thenamespace/uikit/description";
import { Label } from "@thenamespace/uikit/label";

Render Prop Children

Select a plan
"use client";

import { RadioButtonGroup } from "@thenamespace/uikit";
import { Description } from "@thenamespace/uikit/description";
import { Label } from "@thenamespace/uikit/label";

With Icons

Payment method
"use client";

import { RadioButtonGroup } from "@thenamespace/uikit";
import { Description } from "@thenamespace/uikit/description";
import { Label } from "@thenamespace/uikit/label";

With Ripple

Deploy region
"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-visible or [data-focus-visible="true"] on .radio-button-group__item (focus ring)
  • Disabled: :disabled or [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.

PropTypeDefaultDescription
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
PropTypeDefaultDescription
childrenReactNode-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.

PropTypeDefaultDescription
childrenReactNode-Content elements

Also supports all native div HTML attributes.

RadioButtonGroup.ItemIcon

Leading icon container.

PropTypeDefaultDescription
childrenReactNode-Icon element

Also supports all native div HTML attributes.