Checkbox
A styled checkbox with checked, mixed, required and native form states.
Installation
npx shadcn@latest add @navui/checkboxUsage
Use a checkbox for an independent choice or compose a set with UI SDK’s CheckboxGroup. Install NavUI Field for the labels and descriptions in these examples.
import { Checkbox } from "@/components/navui/checkbox";
import { Field, FieldLabel } from "@/components/navui/field";
export function DeploymentNotifications() {
return (
<Field name="deployments" className="min-h-8 flex-row items-center gap-3 pointer-coarse:min-h-11">
<Checkbox value="enabled" />
<FieldLabel>Deployment notifications</FieldLabel>
</Field>
);
}Examples
Default
With a description
Add recent deployments to each activity report.
Disabled
Managed by your organization
Select all and mixed state
Click Select all sections or change an individual selection.
Notification channels
Required checkbox in a form
Uses NavUI Button to submit or reset the form.
Selectable cards
Click anywhere on a card to select an export format.
Analyze activity in a spreadsheet.
Share a formatted overview with your team.
API reference
Foundation component styled on UI SDK Checkbox. See the UI SDK Checkbox documentation for the complete inherited API.
Accessibility
- Use a visible label and place supporting text in FieldDescription.