Checkbox

A role="checkbox" control whose tick is drawn as an SVG stroke, that dips when pressed and shows a dash for the mixed state through indeterminate. Takes an optional label and aria-describedby for error text, and grows to a 44px hit area on touch devices.

Preview

Checkbox preview width

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @karaui/checkbox
@karaui not found? Add it to components.json
{
  "registries": {
    "@karaui": "https://karaui.kamisama-v0.my.id/r/{name}.json"
  }
}

@karaui is in shadcn's public registry directory, so the latest CLI needs no setup. On an older CLI, merge this into the existing file once and every @karaui/… install resolves.

API Reference

checked
boolean
—
onCheckedChange
(checked: boolean) => void
—
disabled?
boolean
—
indeterminate?
boolean
—
label?
string
—
className?
string
—
id?
string
—
aria-label?
string
—
aria-describedby?
string

Associates an external message (e.g. a form error) with the control.

—

Updated