Props
| Name | Description |
|---|---|
autofocus Type: Booleanish | Focuses the field when it mounts (a dialog already open included), unless the user is typing in another field. |
checked Type: boolean | Defines the input as checked. Overrides the model-derived display, so it is how a select-all master paints itself from its children. Passing it together with a |
compact Type: booleanDefaultfalse | Compact density. Swaps |
description Type: string | Text between the label and the input. Unlike the hint it is always visible; it joins the input's Always visible, unlike |
disabled Type: booleanDefaultfalse | Disables the component. Takes the box out of the tab order and out of the form post. When the value must still reach the server, you want |
errors Type: string | string[] | Error messages under the field, a string or array, in an A non-empty value puts the field in the error state by itself; |
falseValue Type: any | Value of the input when unchecked. It handles any kind of serializable object. See example |
formless Type: booleanDefaultfalse | Keep this control out of the enclosing |
hasErrors Type: booleanDefaultfalse | Define if the component should be in an error state. It usually attaches a CSS class for styling purposes. |
hasWarnings Type: booleanDefaultfalse | Define if the component should be in a warning state. Same chrome as errors with |
hideLabel Type: booleanDefaultfalse | Visually hides the label of the input while maintaining accessibility. For dense composites where visible text already labels the box, such as a selection column in a table. It hides the label, it does not remove it: |
hint Type: string | Text box to be displayed near the input, usually to indicate instructions. Hidden until the field has focus unless |
id Type: string | The |
indeterminate Type: booleanDefaultfalse | Sets the input in an indeterminate state. Visual only: it never enters the model, and the component re-applies it after a click because the native state resets on interaction. If the server needs a real tri-state value, model it explicitly. See example |
inputAlign Type: FieldCrossAlign | Vertical position of the control in a side-by-side row; not |
inputPosition Type: "left" | "center" | "right"Default"left" | Sets the alignment of the input. Since inputs are inline block they can be aligned just as text can. See example |
label requiredType: string | Text content of the label of the element. Required, because it is the accessible name. It stays required when you replace the rendered text through the |
labelAlign Type: FieldCrossAlign | Vertical position of the label block in a side-by-side row; not |
labelPosition Type: "left" | "center" | "right" | Sets the text alignment of the label. |
layout Type: Responsive<FieldLayout>Default"auto" | How label and input sit together: A two-token pattern such as |
modelValue Type: any | Used by v-model. Can be any serializable type. |
name Type: string | Defines the name of the input. Generated when omitted, which is fine in an SPA and not in a form that posts. Pass it whenever the value has to arrive under a known key. See example |
persistentHint Type: booleanDefaultfalse | Keeps the hint displayed. See example |
pt Type: PtMap<TogglePtPart, CheckablePtState> | Passthrough, object form: the same keys as the |
pt:<part> Type: PtValue | Passthrough, attribute form: one attribute per part, |
readonly Type: booleanDefaultfalse | Sets the input in a readonly state. Not the same as |
required Type: booleanDefaultfalse | Sets the input as required. Sets the native attribute and the marker (unless |
reverse Type: booleanDefaultfalse | Reverses the layout: in every direction the order of the label and the input is swapped from the standard arrangement. Its meaning inverted in v3 and the compiler cannot see it. The default rendering is unchanged, but |
rules Type: RuleExpression<any> | vee-validate rules for this field. Only inside a Inside a |
submitWhenFalse Type: booleanDefaultfalse | Will submit "falseValue" if the input is not checked. Otherwise "trueValue" will be submitted. An unchecked box posts nothing at all: standard HTML, and a recurring surprise on the server. This renders a hidden input carrying |
trueValue Type: any | Value of the input when checked. It handles any kind of serializable object. Checked-ness is derived by deep equality against this value, so object values match structurally rather than by reference. See example |
validationLabel Type: string | The field's name in validation messages ( The name the rule messages use for |
validationMode Type: ValidationMode | When the field validates: |
warnings Type: string | string[] | Warning messages under the field, a string or array: amber, in their own The amber counterpart of |
v-model
Values kept in sync through v-model.
| Name | Description |
|---|---|
modelValue Type: any | Carries |
Events
| Name | Description |
|---|---|
blur Type: (event: FocusEvent): void | Emitted when the native input loses focus. Forwards the original DOM |
change Type: (event: Event): void | Emitted when the checkbox checked state changes. Forwards the original DOM |
click Type: (event: MouseEvent): void | Emitted when the input receives a click interaction. Forwards the original DOM |
focus Type: (event: FocusEvent): void | Emitted when the native input gains focus. Forwards the original DOM |
input Type: (event: Event): void | Emitted on native input events from the checkbox input. Forwards the original DOM |
keydown Type: (event: KeyboardEvent): void | Emitted for keyboard interaction on the input. Forwards the original DOM |
mousedown Type: (event: MouseEvent): void | Emitted when a pointing device button is pressed over the input. Forwards the original DOM |
mouseup Type: (event: MouseEvent): void | Emitted when a pointing device button is released over the input. Forwards the original DOM |
update:modelValue Type: (value: any): void | Emitted on checked-state changes with the effective model value:
- |
Slots
The listed properties are the ones exposed to the slot scope.
| Name | Description |
|---|---|
description Type: BbCheckboxDescriptionSlotProps | Replaces the description text. Provided alone (no |
icon Type: BbCheckboxIconSlotProps | Replaces the default checkmark SVG inside the checkbox box. Receives the checkbox state plus the label text. Replaces the entire box visual (border, background and checkmark), so the slot content has to communicate every state itself. When the row around it is the problem rather than the box, drop to |
label Type: BbCheckboxLabelSlotProps | Replaces the default label text rendered next to the checkbox. Receives |
Renamed and removed
Names from v2 and from earlier 3.0 betas that no longer work, and what to write instead.
colorremovedfails silentlydirectionlayoutfails silentlyhasWarninghasWarningsfails silentlyvalidateOnvalidationModefails silentlyAn array of events became one mode (
aggressive|balanced|lazy|submit-only|submit-live). The old defaults (['blur'],['inactive'], a toggle's['update:modelValue', 'change', 'blur']) arebalanced, the new default: delete the prop. A text field on['update:modelValue']isvalidation-mode="aggressive". Set it once on<BbForm validation-mode>instead of per field.vidremovedfails silentlyA display name (v2:
vid="Email address") is nowvalidation-label; a field path (3.0 betas:vid="address.city") is nowname(brackets for a native post:address[city]).check --fixpicks by the value.