Murasaki

Checkbox

A control that allows the user to toggle between checked and not checked.

import { Checkbox, Label } from "@murasakijs/ui";export function CheckboxDemo() {return (  <div className="flex items-center gap-2">    <Checkbox id="terms" />    <Label htmlFor="terms">Accept terms and conditions</Label>  </div>);}

Usage

import { Checkbox } from "@murasakijs/ui";
<Checkbox id="terms" />

API Reference

Props

PropTypeDefault
checkedboolean | "indeterminate"
defaultCheckedboolean | "indeterminate"
onCheckedChange(checked: boolean | "indeterminate") => void
disabledbooleanfalse
requiredbooleanfalse
namestring
valuestring"on"

Checkbox renders a Radix UI Checkbox.Root; all other props are forwarded to it.

Improve this page on GitHub

On this page