# Checkbox preview

Interactive preview of the CyberSpec Checkbox component. A cut box that fills and marks when checked, with an indeterminate state.

[View Checkbox preview on CyberSpec](https://www.cyberspec.dev/preview/checkbox)

## About this preview

Checkbox belongs to the Choices group in the CyberSpec catalog. It uses @ui-sdk/react/checkbox.

## 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/checkbox.json
```

## Example

```tsx
"use client"

import { Checkbox, CheckboxGroup } from "@/components/ui/checkbox"

export default function CheckboxDemo() {
  return (
    <>
      <CheckboxGroup label="Objectives" defaultValue={["relay"]}>
        <Checkbox value="relay" label="Reach the Glasswater relay" />
        <Checkbox value="splice" label="Splice the Vanta trunk line" />
        <Checkbox value="exfil" label="Exfil with Dex Marlowe" hint="Locked until the trunk is spliced." disabled />
      </CheckboxGroup>
    </>
  )
}
```

## Install this example

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

## Resources

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