Components
Checkbox Field

Checkbox Field

A checkbox field component for use inside a form, used for boolean input

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

PropTypeDefault
name*string
idstring
labelstring
placeholderstring
requiredboolean
readOnlyboolean
errorstring
checkedboolean
defaultCheckedboolean
onChangeevent
classNamestring