Props
| Name | Type | Default | Description |
|---|---|---|---|
autofocus | Booleanish | undefined | - | Sets autofocus on page load. |
compact | boolean | undefined | false | Sets the component in a compact state. |
dependencies | unknown[] | undefined | - | Defines an array of dependencies that will trigger actions in the component upon change. |
depsDebounceTime | number | undefined | - | Timeout used to debounce response to changes to dependencies. |
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 The place to say why some options are locked. Arrow keys skip a non-selectable radio entirely, so a keyboard user never lands on one to find out. See example |
direction | InputDirection | undefined | - | 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. Locks the group. Prefer |
enforceCoherence | boolean | undefined | false | If coherence is enforced the input cannot have a modelValue that is incoherent with its current items. e.g. You cannot set v-model to a user that is not present in the items passed. modelValue will be reset upon incoherence. |
errors | string | string[] | undefined | - | Can be a string or an array of string containing the messages to display.
They render in an The channel that produces the sentence the user reads. |
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 each option's label text (the text rendered next to every
input) while keeping it accessible to screen readers.
Does not affect the fieldset legend — use |
hideLegend | boolean | undefined | false | Visually hides the legend of the fieldset while maintaining accessibility. The right way to drop the legend visually. Removing it instead costs the group its |
hint | string | undefined | - | Text box to be displayed near the input, usually to indicate instructions. |
id | string | undefined | - | The identifier of the component. |
inputDirection | "horizontal" | "vertical" | undefined | - | Defines the direction of the inputs in the fieldset. Defaults to |
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. |
itemProps | BbOptionGroupItemProps<T> | undefined | - | ADDITIONAL row fields resolved from each item — never its text or value
(those stay on |
itemsrequired | T[] | ((prefill: boolean, modelValue?: any) => T[] | Promise<T[]>) | - | Used to retrieve items; can be an array or a function. Same mapping as every other options component. A radio group has no |
itemText | ItemAccessor<T, string> | undefined | - | Defines a path that returns a property of the object to use as text or a function that returns a string. See example |
itemValue | ItemAccessor<T> | undefined | - | Defines a path that returns a property of the object to use as value or a function that returns any value. See example |
legendrequired | string | - | Text content of the legend. Required, and load-bearing twice over here: it is the fieldset's accessible name and it is what lets the options container claim |
legendMode | "outside" | "inside" | undefined | - | Legend rendering mode. |
legendPosition | "left" | "center" | "right" | undefined | - | Sets the text alignment of the label. |
loadingText | string | undefined | - | String displayed while items are being loaded. |
modelValuerequired | any | - | Used by v-model. Can be any serializable type. |
modelValueDebounceTime | number | undefined | - | Timeout used to debounce response to changes to modelValue. |
name | string | undefined | - | Defines the name of the option inputs. Optional: the options live inside a single component instance, so an omitted name falls back to a generated one that groups them correctly on its own — unique per group, so two groups never clear each other's selection, and stable for the group's lifetime. Pass a name only when the value has to be submitted under a known key by a native (non-JS) form post. No longer required in v3. An omitted name falls back to a generated one, unique per group instance and stable for its lifetime, so two unnamed groups never clear each other. Pass one when the value has to post under a known key. A hand-composed set of |
noDataText | string | undefined | - | String displayed when there are no items to display. |
persistentHint | boolean | undefined | false | Keeps the hint displayed. |
pt | GroupPtMap<T> | undefined | - | Passthrough, object form: the same keys as the |
pt:description | PtValue | undefined | - | |
pt:description:disabled | PtValue | undefined | - | |
pt:description:errors | PtValue | undefined | - | |
pt:description:has-value | PtValue | undefined | - | |
pt:description:loading | PtValue | undefined | - | |
pt:description:readonly | PtValue | undefined | - | |
pt:description:warnings | PtValue | undefined | - | |
pt:hint | PtValue | undefined | - | |
pt:hint:disabled | PtValue | undefined | - | |
pt:hint:errors | PtValue | undefined | - | |
pt:hint:has-value | PtValue | undefined | - | |
pt:hint:loading | PtValue | undefined | - | |
pt:hint:readonly | PtValue | undefined | - | |
pt:hint:warnings | PtValue | undefined | - | |
pt:icon | PtValue | ((ctx: PtItemCtx<T, GroupPtState>) => PtItemResult) | 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:has-value | PtValue | undefined | - | |
pt:icon:loading | PtValue | undefined | - | |
pt:icon:readonly | PtValue | undefined | - | |
pt:icon:warnings | PtValue | undefined | - | |
pt:item | PtValue | ((ctx: PtItemCtx<T, GroupPtState>) => PtItemResult) | undefined | - | |
pt:item-description | PtValue | ((ctx: PtItemCtx<T, GroupPtState>) => PtItemResult) | undefined | - | |
pt:item-description:checked | PtValue | undefined | - | |
pt:item-description:disabled | PtValue | undefined | - | |
pt:item-description:errors | PtValue | undefined | - | |
pt:item-description:focus-visible | PtValue | undefined | - | |
pt:item-description:focused | PtValue | undefined | - | |
pt:item-description:has-value | PtValue | undefined | - | |
pt:item-description:loading | PtValue | undefined | - | |
pt:item-description:readonly | PtValue | undefined | - | |
pt:item-description:warnings | PtValue | undefined | - | |
pt:item:checked | PtValue | undefined | - | |
pt:item:disabled | PtValue | undefined | - | |
pt:item:errors | PtValue | undefined | - | |
pt:item:focus-visible | PtValue | undefined | - | |
pt:item:focused | PtValue | undefined | - | |
pt:item:has-value | PtValue | undefined | - | |
pt:item:loading | PtValue | undefined | - | |
pt:item:readonly | PtValue | undefined | - | |
pt:item:warnings | PtValue | undefined | - | |
pt:label | PtValue | ((ctx: PtItemCtx<T, GroupPtState>) => PtItemResult) | 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:has-value | PtValue | undefined | - | |
pt:label:loading | PtValue | undefined | - | |
pt:label:readonly | PtValue | undefined | - | |
pt:label:warnings | PtValue | undefined | - | |
pt:legend | PtValue | undefined | - | |
pt:legend:disabled | PtValue | undefined | - | |
pt:legend:errors | PtValue | undefined | - | |
pt:legend:has-value | PtValue | undefined | - | |
pt:legend:loading | PtValue | undefined | - | |
pt:legend:readonly | PtValue | undefined | - | |
pt:legend:warnings | PtValue | undefined | - | |
pt:list | PtValue | undefined | - | |
pt:list:disabled | PtValue | undefined | - | |
pt:list:errors | PtValue | undefined | - | |
pt:list:has-value | PtValue | undefined | - | |
pt:list:loading | PtValue | undefined | - | |
pt:list:readonly | PtValue | undefined | - | |
pt:list:warnings | PtValue | undefined | - | |
pt:message | PtValue | undefined | - | |
pt:message:disabled | PtValue | undefined | - | |
pt:message:errors | PtValue | undefined | - | |
pt:message:has-value | PtValue | undefined | - | |
pt:message:loading | PtValue | undefined | - | |
pt:message:readonly | PtValue | undefined | - | |
pt:message:warnings | PtValue | undefined | - | |
pt:root | PtValue | undefined | - | |
pt:root:disabled | PtValue | undefined | - | |
pt:root:errors | PtValue | undefined | - | |
pt:root:has-value | PtValue | undefined | - | |
pt:root:loading | PtValue | undefined | - | |
pt:root:readonly | PtValue | undefined | - | |
pt:root:warnings | PtValue | undefined | - | |
readonly | boolean | undefined | false | Sets the input in a readonly state. The |
required | boolean | undefined | false | Sets the input as required. The only one of the three groups with this prop, because one value is either present or absent. It marks the field for assistive technology and raises the asterisk; the message still comes from |
reverse | boolean | undefined | false | Reverses the layout. Applicable in every direction the order of the label and the input is swapped. |
selectable | boolean | ((item: T) => boolean) | undefined | true | Defines whether options are selectable. Can be a global boolean that affects all options or a function that accepts an item and returns a boolean that only affects that item. Non-selectable options are rendered disabled. A rejected option is skipped by the arrow keys, not merely greyed, so the reason has to be written somewhere the user will read. Also where v2's per-item |
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 resolved value, never an array — seed it |
Events
| Name | Type | Description |
|---|---|---|
active | (e: "active"): void | Emitted when the group becomes active (focus/click enters it). |
blur | (e: "blur", event: FocusEvent): void | Emitted when one of the generated radio inputs loses focus.
Forwards the original DOM |
change | (e: "change", event: Event): void | Emitted when a radio option is selected.
Forwards the original DOM |
click | (e: "click", event: MouseEvent): void | Emitted when one of the generated radio inputs is clicked.
Forwards the original DOM |
focus | (e: "focus", event: FocusEvent): void | Emitted when one of the generated radio inputs receives focus.
Forwards the original DOM |
inactive | (e: "inactive"): void | Emitted when focus/click moves outside the group after it was active. Useful for validation-on-blur flows at group level. |
input | (e: "input", event: Event): void | Emitted on native input events from generated radio inputs.
Forwards the original DOM |
keydown | (e: "keydown", event: KeyboardEvent): void | Emitted for keyboard interaction on generated radio inputs.
Forwards the original DOM |
mousedown | (e: "mousedown", event: MouseEvent): void | Emitted when a pointing device button is pressed over a radio input.
Forwards the original DOM |
mouseup | (e: "mouseup", event: MouseEvent): void | Emitted when a pointing device button is released over a radio input.
Forwards the original DOM |
update:modelValue | (e: "update:modelValue", value: any): void | Emitted with the newly selected value when the selection changes. |
Slots
The listed properties are the ones exposed to the slot scope.
| Name | Type | Description |
|---|---|---|
append | object | Content rendered after the last option, inside the options container. |
description | BbRadioGroupDescriptionSlotProps | Replaces the description text. Provided alone (no |
icon | BbRadioGroupIconSlotProps<T> | Replaces the default radio dot icon for each option. Receives the radio state plus the source item and its display text. Replaces the dot per option and receives |
label | BbRadioGroupLabelSlotProps<T> | Replaces the default label text for each option. Scoped |
legend | BbRadioGroupLegendSlotProps | Replaces the default fieldset legend text for the group. |
loading | object | Content shown while options are loading (replaces the default loading text). |
no-data | object | Content shown when no options are available (replaces the default "no data" text). |
prepend | object | Content rendered before the first option, inside the options container. |
Changes from v2
Props removed or renamed in 3.0. If you are coming from v2, the answer is here.
colorremovedfails silentlyhasWarninghasWarningsfails silentlylabelPositionlegendPositionfails silently