Documentation Index
Fetch the complete documentation index at: https://mintlify.com/rijvi-mahmud/shaddy/llms.txt
Use this file to discover all available pages before exploring further.
CheckboxField wires a single shadcn/ui Checkbox into ShaddyForm’s form context, binding it to a boolean field in your schema. It supports the same flexible layout options as SwitchField — configurable gap, column arrangement, and reversed order — along with a required indicator and automatic validation error messages.
Installation
Install all ShaddyForm fields at once with theshaddy-form registry item:
Usage
Props
The field name. Must match a key in your Zod schema passed to
ShaddyForm.Label text rendered next to the checkbox. Omit to render the checkbox without a visible label.
When
true, appends a red asterisk to the label as a visual indicator.Disables the underlying
Checkbox component when true.When
true, stacks the checkbox and label vertically instead of side by side.When
true, applies justify-between to push the checkbox and label to opposite ends of the container.When
true, renders the label before the checkbox (label on the left). By default the checkbox appears first.The Tailwind gap class applied between the checkbox and its label.
Additional CSS classes applied to the outermost
FormItem wrapper.Notes
CheckboxFieldis intended for a single boolean toggle. To allow users to select multiple values from a list of checkboxes, useCheckboxGroupFieldinstead.- The bound value is a
boolean. Initialise your schema field withz.boolean()and a matchingfalsedefault ininitialValues. - Validation errors are rendered slightly indented (
ml-6) below the checkbox via<FormMessage>. CheckboxFieldmust be rendered inside a<ShaddyForm>— it readscontrolfromuseFormContextinternally.