Accessible custom checkbox for agreements and opt-ins with compact validation feedback.
Required before creating an account.
Accept the terms to continue.
"use client";
import { useState } from "react";
import { CheckboxField } from "@/components/matos-ui/checkbox";
export function CheckboxDemo() {
const [accepted, setAccepted] = useState(false);
return (
<div className="mx-auto w-full max-w-sm">
<CheckboxField
label="I agree to the workspace terms"
description="Required before creating an account."
checked={accepted}
onCheckedChange={setAccepted}
error={accepted ? undefined : "Accept the terms to continue."}
required
/>
</div>
);
}
pnpm dlx shadcn@latest add https://matos-ui.com/r/checkbox.jsonimport { CheckboxField } from "@/components/matos-ui/checkbox"
<CheckboxField
label="I agree to the terms"
checked={field.value}
onCheckedChange={field.onChange}
error={errors.terms?.message}
/>Checkbox wraps the Base UI primitive and CheckboxField adds label, supporting description, and animated validation output.
Install Matos UI
Choose a package manager and copy one command for every component.