Checkbox
Let people select one or more options with accessible checked states.
Preview
Usage
import { z } from 'zod'
import { AutoForm } from '@vitnode/core/components/form/auto-form'
import { AutoFormCheckbox } from '@vitnode/core/components/form/fields/checkbox'const formSchema = z.object({
acceptTerms: z.boolean().refine((val) => val, {
message: 'You must accept the terms and conditions',
}),
})<AutoForm
formSchema={formSchema}
fields={[
{
id: 'acceptTerms',
component: (props) => (
<AutoFormCheckbox
{...props}
label="I accept the terms and conditions"
/>
),
},
]}
/>import { Checkbox } from '@vitnode/core/components/ui/checkbox';<Checkbox onCheckedChange={onCheckedChange} checked={checked} />Props
Prop
Type