Radio group

Options where one is chosen, each with a diamond indicator.

Component

Radio group belongs to the Choices group in the CyberSpec catalog. It uses @ui-sdk/react/radio, @ui-sdk/react/field.

Installation

Use a React 19 project with shadcn configured. Render the installed components inside the Cyber root, and import your global stylesheet in the app entry point.

bunx --bun shadcn@latest add https://www.cyberspec.dev/r/radio-group.json

Example

"use client"

import { RadioGroup } from "@/components/ui/radio-group"

export default function RadioGroupDemo() {
  return (
    <>
      <RadioGroup
        label="Approach"
        defaultValue="quiet"
        options={[
          { value: "quiet", label: "Quiet", hint: "Ghostwrite the door logs. Nobody knows we came." },
          { value: "loud", label: "Loud", hint: "Through the front. Dex keeps the engine running." },
          { value: "talk", label: "Talk", hint: "Needs a broker on the crew.", disabled: true },
        ]}
      />
    </>
  )
}

Install this example

bunx --bun shadcn@latest add https://www.cyberspec.dev/r/radio-group-demo.json

Resources

View as Markdown