# Checkbox

Checked, unchecked, mixed and disabled states.

Access: pro. Category: Forms. Kind: primitive.

## When to use

- Use it when a product interface needs checked, unchecked, mixed and disabled states.
- Choose it when the host application can supply the required state and keep business logic outside the presentation component.

## Alternatives

- Choose form-field instead when a labeled email field with validation and help text is the actual interface need, rather than checkbox.

## Setup for agents

Use React 19 and TypeScript. Initialize shadcn for your framework, then merge this exact entry into components.json:

```json
{
  "registries": {
    "@tidal-pro": {
      "url": "https://tidalui.com/r/pro/{name}.json",
      "headers": {
        "Authorization": "Bearer ${TIDALUI_TOKEN}"
      }
    }
  }
}
```

The namespace must be named **@tidal-pro** because transitive Pro dependencies use that namespace. Obtain an agent key from your active Pro account at https://tidalui.com/account. Keep TIDALUI_TOKEN in your local environment, never in components.json, client code, Git or logs.

```sh
export TIDALUI_TOKEN='your-private-agent-key'
npx shadcn@latest add @tidal-pro/waitlist-form
npx shadcn@latest add https://tidalui.com/r/tidal-button.json
```

Free command: `npx shadcn@latest add https://tidalui.com/r/<name>.json`.
Pro command: `npx shadcn@latest add @tidal-pro/<name>`.

Import the base stylesheet and every stylesheet listed on the installed item's metadata. For example:

```tsx
import "./components/ui/tidal.css";
import "./components/ui/hero-section.css";
// Place installed components inside this wrapper:
<div className="tidal-scope" data-theme="dark">...</div>
```

Omit data-theme for the default light theme. Put the attribute on the same tidal-scope element for dark mode. Every component installs the shared free tidal-base dependency. After upgrading, run `npx shadcn@latest add https://tidalui.com/r/tidal-base.json --overwrite` to receive current tokens. Review local modifications before overwriting.

Vite: Use React + TypeScript. Map @/* to ./src/* in paths and Vite resolve.alias. Import tidal.css and each component stylesheet in your application entry.

Next.js 15 App Router: Next.js App Router: import tidal.css and component CSS in app/layout.tsx. Interactive examples belong in a client component with "use client". Map @/* to ./* or ./src/* to match your project.

TypeScript 6: use paths without baseUrl:

```json
{
  "compilerOptions": {
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
  }
}
```

Pro registry requests are server/CLI-only. Use the same-origin account interface in a browser; cross-origin Authorization preflights are intentionally unsupported.


## Install Checkbox

```sh
npx shadcn@latest add @tidal-pro/checkbox
```

Stylesheets: `components/ui/tidal.css`, `components/ui/checkbox.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/checkbox.css";
import{TidalCheckbox}from"./components/ui/checkbox";
export default()=><div className="tidal-scope"><TidalCheckbox checked={false} label={"Demo"} onCheckedChange={() => {}}/></div>;
```

## Structured props

- `TidalCheckbox.checked: TidalCheckedState`: Required checked value accepted by this exported component.
- `TidalCheckbox.label: string`: Required label value accepted by this exported component.
- `TidalCheckbox.onCheckedChange: (checked: TidalCheckedState) => void`: Callback invoked when the checked change interaction is proposed.
- `TidalCheckbox.description?: string | undefined`: Optional description value accepted by this exported component.
- `TidalCheckbox.error?: string | undefined`: Optional error value accepted by this exported component.
- `TidalCheckbox.rootClassName?: string | undefined` (default ""): Optional root class name value accepted by this exported component.

## Complete usage example

[Source](https://tidalui.com/examples/checkbox.tsx) | [Manifest](https://tidalui.com/examples/checkbox.json). Install the listed additional dependencies. Consumer fixture: TypeScript pass; Vite pass. This fixture check is distinct from the actual shadcn install receipt.

```tsx
import "./components/ui/tidal.css";

import { TidalCheckbox } from "./components/ui/checkbox";

import "./components/ui/checkbox.css";

import { useState } from "react";



const tidalExampleStyles = ".checkbox-specimen{width:100%;max-width:370px;background:var(--t-surface);border:1px solid var(--t-border);border-radius:var(--t-radius-card);padding:23px;box-shadow:0 12px 24px -14px #00000026,0 1px 2px #00000008}.checkbox-specimen>.demo-eyebrow{font-size:11px}.checkbox-specimen>h3{font-size:23px;letter-spacing:-.8px;margin:12px 0 18px;color:var(--t-ink)}.checkbox-demo-progress{font-size:11px;color:var(--t-muted);margin-bottom:14px}.checkbox-demo-progress>div{height:4px;background:var(--t-subtle);border-radius:2px;margin-top:10px;overflow:hidden}.checkbox-demo-progress>div>span{display:block;background:var(--t-accent);height:100%;transition:width 320ms var(--t-ease-out);border-radius:2px}.checkbox-demo-steps{border-top:1px solid var(--t-border);margin-top:8px;padding-top:10px}.checkbox-demo-steps>.tidal-checkbox-row{margin-bottom:9px}.checkbox-demo-status{font-size:11px;color:var(--t-muted);margin:17px 0 0}";

export function CheckboxDemo() {
  const [invite, setInvite] = useState(true);
  const [project, setProject] = useState(false);
  const all =
    invite && project ? true : !invite && !project ? false : "indeterminate";
  return (
    <form
      className="checkbox-specimen"
      onSubmit={(event) => event.preventDefault()}
    >
      <div className="checkbox-demo-progress">
        <span>{Number(invite) + Number(project) + 1} of 3 ready</span>
        <div>
          <span
            style={{
              width: `${((Number(invite) + Number(project) + 1) / 3) * 100}%`,
            }}
          />
        </div>
      </div>
      <TidalCheckbox
        label="Select available steps"
        checked={all}
        onCheckedChange={(value) => {
          setInvite(value === true);
          setProject(value === true);
        }}
      />
      <div className="checkbox-demo-steps">
        <TidalCheckbox
          label="Invite your team"
          description="Add teammates to the sample workspace."
          checked={invite}
          onCheckedChange={(value) => setInvite(value === true)}
          name="steps"
          value="invite"
        />
        <TidalCheckbox
          label="Create your first project"
          description="Add the first sample project."
          checked={project}
          onCheckedChange={(value) => setProject(value === true)}
          name="steps"
          value="project"
        />
        <TidalCheckbox
          label="Workspace protected"
          description="Security settings are already enabled."
          checked={true}
          onCheckedChange={() => {}}
          disabled
          name="steps"
          value="security"
        />
      </div>
      <p className="checkbox-demo-status" role="status">
        {invite && project
          ? "All setup steps complete."
          : "Complete the remaining setup steps."}
      </p>
    </form>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <style>{tidalExampleStyles}</style>
      <CheckboxDemo />
    </div>
  );
}

```

## Gotchas

- The host application owns data, validation, persistence, navigation, and service side effects described by this API.

## Theme and accessibility

{"tokens":["--t-accent","--t-border","--t-border-strong","--t-canvas","--t-danger","--t-display","--t-ease-out","--t-ease-spring","--t-faint","--t-font","--t-ink","--t-line","--t-muted","--t-primary","--t-primary-contrast","--t-radius-card","--t-radius-control","--t-radius-overlay","--t-radius-panel","--t-ring","--t-shadow-lg","--t-shadow-soft","--t-soft","--t-subtle","--t-surface","--t-wash"],"darkMode":true}

{"keyboard":["Tab and Shift+Tab follow the component's native focus order."],"aria":"The component wires labels and relationships from consumer-provided visible text or ARIA props; preserve those labels in production.","notes":"Verify focus visibility, text alternatives, contrast, and reduced motion in the final composition."}

Controlled checked: boolean | indeterminate, onCheckedChange; label required. Optional description, error, rootClassName and Radix Root button/form props/ref: name, value, required, disabled, id, className. Linked visible label/help/error. Radix keyboard Space, mixed semantics and hidden native form input. Consumer owns selection and validation.
