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 and fights 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 Wired into the input's |
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 |
disabled | boolean | undefined | false | Disables the component. Removes the option from the tab order and from the post. Prefer offering a real choice; when you cannot, say why in |
errors | string | string[] | undefined | - | Can be a string or an array of string containing the messages to display.
They render in an Lives on one button, while the error usually belongs to the whole set. Put it on a single radio rather than on each one — repeated, it renders and announces the same sentence per button. A set that needs validation is an argument for |
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. |
hint | string | undefined | - | Text box to be displayed near the input, usually to indicate instructions. |
id | string | undefined | - | The identifier of the component. |
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. |
labelrequired | string | - | Text content of the label of the element. Required on every button: it is the accessible name, and it stays the accessible name when 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. Optional: an omitted name falls back to a
generated one, unique to this button and stable for its lifetime, so a lone
radio needs no name at all. Buttons that must form ONE exclusive group still
have to share an explicit No longer required in v3 — an omitted name is generated per button. That is exactly why a hand-composed group must still pass one shared explicit name: generated names differ, so those buttons never form a native group and you lose exclusivity and arrow-key navigation with it. See example |
persistentHint | boolean | undefined | false | Keeps the hint displayed. |
pt | PtMap<TogglePtPart, TogglePtState> | 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: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: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: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: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: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:readonly | PtValue | undefined | - | |
pt:root:warnings | PtValue | undefined | - | |
readonly | boolean | undefined | false | Sets the input in a readonly state. Blocks changes while staying focusable and still submitting. A lone radio cannot announce it — |
required | boolean | undefined | false | Sets the input as required. |
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 a v2 |
valuerequired | any | - | Defines the value of the radio input. It can be any serializable value. Required, and distinct per button — two buttons sharing a value are not two options. Any serializable value is matched structurally, but prefer stable primitive ids: they survive a refetch and are cheap to submit. See example |
warnings | string | string[] | undefined | - | Warning messages to display beneath the field, in their own |
v-model
Values kept in sync through v-model.
| Name | Type | Description |
|---|---|---|
modelValue | any | One model shared by every button in the set: that is what makes selecting one deselect the rest. It carries the chosen |
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 | BbRadioDescriptionSlotProps | Replaces the description text. Provided alone (no |
icon | BbRadioIconSlotProps | Replaces the default radio dot visual inside the radio container. Receives the radio state plus the label text. Replaces the whole radio-dot visual, so the slot owns selected, unselected and the focus ring. When the row around it is the problem rather than the dot, drop to |
label | BbRadioLabelSlotProps | Replaces the default label text rendered next to the radio button. Receives |
Changes from v2
Props removed or renamed in 3.0. If you are coming from v2, the answer is here.
colorremovedfails silentlyhasWarninghasWarningsfails silently