Checkbox

A native checkbox for crisp choices and settings rows.

Loading preview...

Examples

Practical examples and common states for the same installable component.

Soft

Rounded muted checkbox with a quieter selected state.

examples/checkbox-soft.tsx
import { Checkbox } from "@/components/wensity/checkbox";
export function CheckboxSoft() {
return (
<Checkbox
variant="soft"
defaultChecked
label="Enable smart suggestions"
description="Use recent activity to improve recommendations."
/>
);
}

Group

Group related checkbox choices with shared label and description.

examples/checkbox-group.tsx
"use client";
import * as React from "react";
import { Checkbox, CheckboxGroup } from "@/components/wensity/checkbox";
export function CheckboxGroupDemo() {
const [values, setValues] = React.useState({
email: true,
inApp: true,
sms: false,
});
return (
<CheckboxGroup label="Notification channels">
<Checkbox
label="Email"
checked={values.email}
onCheckedChange={(checked) =>
setValues((current) => ({ ...current, email: checked }))
}
/>
<Checkbox
variant="soft"
label="In-app inbox"
checked={values.inApp}
onCheckedChange={(checked) =>
setValues((current) => ({ ...current, inApp: checked }))
}
/>
<Checkbox
variant="soft"
label="SMS"
checked={values.sms}
onCheckedChange={(checked) =>
setValues((current) => ({ ...current, sms: checked }))
}
/>
</CheckboxGroup>
);
}

Permissions

Card checkbox rows for settings, roles, and permission lists.

examples/checkbox-permissions.tsx
import { CheckboxCard, CheckboxGroup } from "@/components/wensity/checkbox";
export function CheckboxPermissions() {
return (
<CheckboxGroup label="Team permissions">
<CheckboxCard
label="Manage members"
description="Invite teammates, edit roles, and remove access."
defaultChecked
trailing="Admin"
/>
<CheckboxCard
label="Edit registry"
description="Create, update, and publish component entries."
defaultChecked
variant="soft"
trailing="Editor"
/>
<CheckboxCard
label="View analytics"
description="Read usage, downloads, and conversion reports."
trailing="Viewer"
/>
</CheckboxGroup>
);
}

Indeterminate

Mixed state for table headers and bulk selection.

examples/checkbox-indeterminate.tsx
"use client";
import * as React from "react";
import {
Checkbox,
type CheckboxCheckedState,
} from "@/components/wensity/checkbox";
export function CheckboxIndeterminate() {
const [state, setState] =
React.useState<CheckboxCheckedState>("indeterminate");
return (
<Checkbox
checked={state}
onCheckedChange={(checked) => setState(checked)}
label="Select visible rows"
description="Useful for table headers and bulk actions."
/>
);
}

Error

Validation state with error copy connected through aria-describedby.

examples/checkbox-error.tsx
import { Checkbox } from "@/components/wensity/checkbox";
export function CheckboxError() {
return (
<Checkbox
label="I understand the billing impact"
description="Required before changing plan limits."
error="Confirm this before continuing."
/>
);
}

Disabled

Disabled states keep the row readable while blocking interaction.

examples/checkbox-disabled.tsx
import { Checkbox } from "@/components/wensity/checkbox";
export function CheckboxDisabled() {
return (
<div className="space-y-4">
<Checkbox disabled label="SAML single sign-on" />
<Checkbox
disabled
defaultChecked
variant="soft"
label="Audit logging"
/>
</div>
);
}

Settings

A realistic settings list using checkbox cards for independent choices.

examples/checkbox-settings.tsx
import { CheckboxCard } from "@/components/wensity/checkbox";
export function CheckboxSettings() {
return (
<div className="space-y-3">
<CheckboxCard
label="Weekly product digest"
description="A concise summary of new components and fixes."
defaultChecked
/>
<CheckboxCard
label="Realtime billing alerts"
description="Send a notification when usage crosses plan limits."
defaultChecked
/>
<CheckboxCard
label="Security review required"
description="Require admin approval for new API tokens."
variant="soft"
/>
</div>
);
}