Usage
'use client';
import * as React from 'react';
import { CheckboxField } from '@/components/ui/formfield';
export function CheckboxFieldDemo() {
return (
<form className="flex flex-col gap-4 p-4">
<CheckboxField name="required" label="Is Required" defaultValue={false} required={true} />
<CheckboxField name="active" label="Is User Active" />
</form>
);
}
'use client';
import * as React from 'react';
import { CheckboxField } from '@/components/ui/formfield';
export function CheckboxFieldDemo() {
return (
<form className="flex flex-col gap-4 p-4">
<CheckboxField name="required" label="Is Required" defaultValue={false} required={true} />
<CheckboxField name="active" label="Is User Active" />
</form>
);
}
API Reference
Prop | Type | Default |
---|---|---|
name* | string | |
id | string | |
label | string | |
placeholder | string | |
required | boolean | |
readOnly | boolean | |
error | string | |
checked | boolean | |
defaultChecked | boolean | |
onChange | event | |
className | string |