Choice list

Replies to choose from: rows in the signal color, the chosen one a solid yellow bar.

Component

Choice list belongs to the Choices group in the CyberSpec catalog. It uses @ui-sdk/react/radio.

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/choice-list.json

Example

"use client"

import { ChoiceList } from "@/components/ui/choice-list"

export default function ChoiceListDemo() {
  return (
    <>
      <ChoiceList
        label="Reply to Mara Voss"
        defaultValue="accept"
        options={[
          { value: "accept", label: "Send the route. I'm in." },
          { value: "terms", label: "What does it pay, and who else is on it?" },
          { value: "later", label: "Mid-run. Ask me again after dark." },
          { value: "decline", label: "Not this one, Mara." },
        ]}
      />
    </>
  )
}

Install this example

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

Resources

View as Markdown