Basic Usage
Controlled State
Checkbox Without Label
For cases where the label is provided separately (e.g., in a table cell):When using Checkbox without a label, always provide an
aria-label for accessibility.Learn more about Mintlify
Enter your email to receive updates about new features and product releases.
Allow users to select multiple options from a set.
import { Checkbox } from "@soft-ui/react/checkbox"
function Example() {
return <Checkbox label="Accept terms and conditions" />
}
import { useState } from "react"
import { Checkbox } from "@soft-ui/react/checkbox"
function Example() {
const [checked, setChecked] = useState(false)
return (
<Checkbox
label="Subscribe to newsletter"
checked={checked}
onCheckedChange={setChecked}
/>
)
}
import { Checkbox } from "@soft-ui/react/checkbox"
function Example() {
return <Checkbox aria-label="Select row" />
}
aria-label for accessibility.import { Checkbox } from "@soft-ui/react/checkbox"
function Example() {
return (
<Checkbox
label="Select all"
checked="indeterminate"
/>
)
}
import { Checkbox } from "@soft-ui/react/checkbox"
function Example() {
return (
<Checkbox
label="This option is disabled"
disabled
/>
)
}