# Choice list preview

Interactive preview of the CyberSpec Choice list component. Replies to choose from: rows in the signal color, the chosen one a solid yellow bar.

[View Choice list preview on CyberSpec](https://www.cyberspec.dev/preview/choice-list)

## About this preview

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.

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

## Example

```tsx
"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

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

## Resources

- [Choice list documentation](https://www.cyberspec.dev/components/sidebar/choice-list.md)
- [Component catalog](https://www.cyberspec.dev/components.md)
- [Choice list source code](https://github.com/agnelnieves/cyberspec/blob/main/registry/cyber/ui/choice-list.tsx)
- [Shadcn registry item](https://www.cyberspec.dev/r/choice-list.json)
