Props
| Name | Type | Default | Description |
|---|---|---|---|
autofocus | Booleanish | undefined | - | Sets autofocus on page load. |
checked | boolean | undefined | - | 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 |
description | string | undefined | - | Descriptive text displayed below the label and above the input. Unlike the hint it is always
visible, and it is linked to the input via Always visible, unlike |
direction | InputDirection | undefined | "auto" | Direction of the layout of the component. Can either be a predefined value or a pattern separated by a space like A two-token pattern such as |
disabled | boolean | undefined | false | 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 | string | string[] | undefined | - | Can be a string or an array of string containing the messages to display.
They render in an A non-empty value puts the field in the error state by itself; |
falseValue | any | - | Value of the input when unchecked. It handles any kind of serializable object. See example |
hasErrors | boolean | undefined | false | Define if the component should be in an error state. It usually attaches a CSS class for styling purposes. See example |
hasWarnings | boolean | undefined | false | Define if the component should be in a warning state.
Same chrome as errors with |
hideLabel | boolean | undefined | false | Visually hides the label of the input while maintaining accessibility. For dense composites where visible text already labels the box — a selection column in a table. It hides the label, it does not remove it: |
hint | string | undefined | - | Text box to be displayed near the input, usually to indicate instructions. Hidden until the field has focus unless |
id | string | undefined | - | The identifier of the component. |
indeterminate | boolean | undefined | false | 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 |
inputPosition | "left" | "center" | "right" | undefined | "left" | Sets the alignment of the input. Since inputs are inline block they can be aligned just as text can. See example |
labelrequired | 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 |
labelPosition | "left" | "center" | "right" | undefined | - | Sets the text alignment of the label. |
modelValue | any | - | Used by v-model. Can be any serializable type. |
name | string | undefined | - | 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 | boolean | undefined | false | Keeps the hint displayed. See example |
pt | PtMap<TogglePtPart, CheckablePtState> | undefined | - | Passthrough, object form: the same keys as the |
pt:description | PtValue | undefined | - | |
pt:description:checked | PtValue | undefined | - | |
pt:description:disabled | PtValue | undefined | - | |
pt:description:errors | PtValue | undefined | - | |
pt:description:focus-visible | PtValue | undefined | - | |
pt:description:focused | PtValue | undefined | - | |
pt:description:indeterminate | PtValue | undefined | - | |
pt:description:readonly | PtValue | undefined | - | |
pt:description:warnings | PtValue | undefined | - | |
pt:hint | PtValue | undefined | - | |
pt:hint:checked | PtValue | undefined | - | |
pt:hint:disabled | PtValue | undefined | - | |
pt:hint:errors | PtValue | undefined | - | |
pt:hint:focus-visible | PtValue | undefined | - | |
pt:hint:focused | PtValue | undefined | - | |
pt:hint:indeterminate | PtValue | undefined | - | |
pt:hint:readonly | PtValue | undefined | - | |
pt:hint:warnings | PtValue | undefined | - | |
pt:icon | PtValue | undefined | - | |
pt:icon:checked | PtValue | undefined | - | |
pt:icon:disabled | PtValue | undefined | - | |
pt:icon:errors | PtValue | undefined | - | |
pt:icon:focus-visible | PtValue | undefined | - | |
pt:icon:focused | PtValue | undefined | - | |
pt:icon:indeterminate | PtValue | undefined | - | |
pt:icon:readonly | PtValue | undefined | - | |
pt:icon:warnings | PtValue | undefined | - | |
pt:label | PtValue | undefined | - | |
pt:label:checked | PtValue | undefined | - | |
pt:label:disabled | PtValue | undefined | - | |
pt:label:errors | PtValue | undefined | - | |
pt:label:focus-visible | PtValue | undefined | - | |
pt:label:focused | PtValue | undefined | - | |
pt:label:indeterminate | PtValue | undefined | - | |
pt:label:readonly | PtValue | undefined | - | |
pt:label:warnings | PtValue | undefined | - | |
pt:message | PtValue | undefined | - | |
pt:message:checked | PtValue | undefined | - | |
pt:message:disabled | PtValue | undefined | - | |
pt:message:errors | PtValue | undefined | - | |
pt:message:focus-visible | PtValue | undefined | - | |
pt:message:focused | PtValue | undefined | - | |
pt:message:indeterminate | PtValue | undefined | - | |
pt:message:readonly | PtValue | undefined | - | |
pt:message:warnings | PtValue | undefined | - | |
pt:root | PtValue | undefined | - | |
pt:root:checked | PtValue | undefined | - | |
pt:root:disabled | PtValue | undefined | - | |
pt:root:errors | PtValue | undefined | - | |
pt:root:focus-visible | PtValue | undefined | - | |
pt:root:focused | PtValue | undefined | - | |
pt:root:indeterminate | PtValue | undefined | - | |
pt:root:readonly | PtValue | undefined | - | |
pt:root:warnings | PtValue | undefined | - | |
readonly | boolean | undefined | false | Sets the input in a readonly state. Not the same as |
required | boolean | undefined | false | Sets the input as required. Sets the native attribute, so the box joins native form validation. For app-driven validation prefer |
reverse | boolean | undefined | false | 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 |
submitWhenFalse | boolean | undefined | false | 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 | 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 |
warnings | string | string[] | undefined | - | Warning messages to display beneath the field, in their own The amber counterpart of |
v-model
Values kept in sync through v-model.
| Name | Type | Description |
|---|---|---|
modelValue | any | Carries |
Events
| Name | Type | Description |
|---|---|---|
blur | (event: "blur", event: FocusEvent): void | |
change | (event: "change", event: Event): void | |
click | (event: "click", event: MouseEvent): void | |
focus | (event: "focus", event: FocusEvent): void | |
input | (event: "input", event: Event): void | |
keydown | (event: "keydown", event: KeyboardEvent): void | |
mousedown | (event: "mousedown", event: MouseEvent): void | |
mouseup | (event: "mouseup", event: MouseEvent): void | |
update:modelValue | (event: "update:modelValue", value: any): void |
Slots
The listed properties are the ones exposed to the slot scope.
| Name | Type | Description |
|---|---|---|
description | BbCheckboxDescriptionSlotProps | Replaces the description text. Provided alone (no |
icon | 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 | BbCheckboxLabelSlotProps | Replaces the default label text rendered next to the checkbox. Receives |
Changes from v2
Props removed or renamed in 3.0. If you are coming from v2, the answer is here.
colorremovedfails silentlyhasWarninghasWarningsfails silently