Single checkbox bound to a boolean attribute.
| Builder | F.checkbox(attribute: string): Checkbox |
| Wire type key | checkbox |
| Class chain | Checkbox → BooleanField → Field |
| Detail projection | text-entry |
| Column counterpart | boolean cell, i.e. C.boolean(attribute) |
Example
import { F } from '@adonia/core'
F.checkbox('acceptsTerms').label('I accept the terms').required()Props
Beyond the shared field DSL:
| Prop | Declared on | Behaviour |
|---|---|---|
inline(): this |
Checkbox |
Renders the label beside the box instead of above it — the layout a consent checkbox wants, and the reason checkbox exists next to toggle at all. |
asInteger(): this |
BooleanField |
Stores the sqlite-shaped 0/1 integer instead of a boolean (§7.3). Needed when the model does NOT declare a boolean column consumer; with it, BooleanField.defaultDehydrate writes 1/0, which BooleanField.defaultHydrate reads straight back. |
Validation
Vine base: vine.boolean().
§11.1 mapping: vine.boolean().
Contributed by BooleanField.vineSchema() in packages/core/src/schema/fields/boolean_field.ts. The shared modifiers (required, nullable, requiredWhen, unique, optionality) are applied on top by Field.buildValidation, and a rules() override replaces the base entirely — the validator compiler never branches on the field class.
Declared in
packages/core/src/schema/fields/checkbox.ts—Checkboxpackages/core/src/schema/fields/boolean_field.ts—BooleanField