Checkbox
Toggle between checked and unchecked 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-frontend/components/ui/checkbox';<Checkbox onChange={onChange} checked={checked} />Props
Prop
Type