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. |
compact Type: booleanDefaultfalse | Compact density. Swaps |
dependencies Type: unknown[] | Defines an array of dependencies that will trigger actions in the component upon change. |
depsDebounceTime Type: number | Timeout used to debounce response to changes to dependencies. |
description Type: string | Text between the label and the input. Unlike the hint it is always visible; it joins the input's 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 |
disabled Type: booleanDefaultfalse | Disables the component. Locks every option, the chosen one included, and keeps the value out of a native post. To freeze a choice that must still be submitted, use |
emptyText Type: string | String displayed when there are no items to display. |
enforceCoherence Type: booleanDefaultfalse | After every applied, successful load (an empty one included), drops the model values the options no longer contain (a single value resets to |
errors Type: string | string[] | Error messages under the field, a string or array, in an Your own messages. Inside a |
failedText Type: stringDefaultthe localized common.failedText ("Couldn't load items") | String displayed in the empty state while the latest load FAILED (the |
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 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 Type: booleanDefaultfalse | 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 Type: string | Text box to be displayed near the input, usually to indicate instructions. |
id Type: string | Prefix for the ids of each option's input and of the label, description and message. Generated when omitted. |
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. |
itemInputAlign Type: FieldCrossAlign | Vertical position of each option's control in its row; |
itemLabelAlign Type: FieldCrossAlign | Vertical position of each option's label in its row. Omitted, it stays as it is. |
itemLayout Type: FieldLayoutDefault'auto' | How each row's input and label sit together, in the |
itemProps Type: BbOptionGroupItemProps<T> | ADDITIONAL row fields, never the text or value: |
itemReverse Type: booleanDefaultfalse | Swaps each row's input and label from their natural order (input first), in every |
items requiredType: T[] | ((context: BbRadioGroupItemsContext) => T[] | Promise<T[]>) | The options: an array, or a provider called with a Same mapping as every other options component. A radio group has no |
itemText Type: ItemAccessor<T, string>Defaultown label, else text, else JSON.stringify(item) | Defines a path that returns a property of the object to use as text or a function that returns a string.
Unset: own |
itemValue Type: ItemAccessor<T>Defaultown value, else the whole item | Defines a path that returns a property of the object to use as value or a function that returns any value.
Unset: own |
labelAlign Type: FieldCrossAlign | Vertical position of the label block in a side-by-side row; not |
layout Type: Responsive<FieldLayout> | How label and input sit together: |
legend requiredType: 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 Type: "outside" | "inside" | Legend rendering mode. |
legendPosition Type: "left" | "center" | "right" | Sets the text alignment of the label. |
listLayout Type: ListLayoutDefault'horizontal' | How the rows sit in the list: Defaults to |
loadingText Type: string | String displayed while items are being loaded. |
modelValue Type: any | Used by v-model. Can be any serializable type. |
modelValueDebounceTime Type: number | Timeout used to debounce response to changes to modelValue. |
name Type: string | Name of the option inputs. Optional: a generated one, unique per group and stable, groups them. Pass one only when a native (non-JS) form post must submit the value under a known key. 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 |
persistentHint Type: booleanDefaultfalse | Keeps the hint displayed. |
pt Type: ({ root?: PtValue | undefined; "root:loading"?: PtValue | undefined; "icon:loading"?: PtValue | undefined; "root:disabled"?: PtValue | undefined; "root:errors"?: PtValue | undefined; "root:warnings"?: PtValue | undefined; "root:readonly"?: PtValue | undefined; "icon:disabled"?: PtValue | undefined; "item:disabled"?: PtValue | undefined; description?: PtValue | undefined; message?: PtValue | undefined; hint?: PtValue | undefined; "icon:errors"?: PtValue | undefined; "icon:warnings"?: PtValue | undefined; "icon:readonly"?: PtValue | undefined; "icon:checked"?: PtValue | undefined; "icon:focused"?: PtValue | undefined; "icon:focusVisible"?: PtValue | undefined; "label:disabled"?: PtValue | undefined; "label:errors"?: PtValue | undefined; "label:warnings"?: PtValue | undefined; "label:readonly"?: PtValue | undefined; "label:checked"?: PtValue | undefined; "label:focused"?: PtValue | undefined; "label:focusVisible"?: PtValue | undefined; "description:disabled"?: PtValue | undefined; "description:errors"?: PtValue | undefined; "description:warnings"?: PtValue | undefined; "description:readonly"?: PtValue | undefined; "message:disabled"?: PtValue | undefined; "message:errors"?: PtValue | undefined; "message:warnings"?: PtValue | undefined; "message:readonly"?: PtValue | undefined; "hint:disabled"?: PtValue | undefined; "hint:errors"?: PtValue | undefined; "hint:warnings"?: PtValue | undefined; "hint:readonly"?: PtValue | undefined; legend?: PtValue | undefined; list?: PtValue | undefined; indicator?: PtValue | undefined; "root:hasValue"?: PtValue | undefined; "description:loading"?: PtValue | undefined; "description:hasValue"?: PtValue | undefined; "message:loading"?: PtValue | undefined; "message:hasValue"?: PtValue | undefined; "hint:loading"?: PtValue | undefined; "hint:hasValue"?: PtValue | undefined; "legend:loading"?: PtValue | undefined; "legend:disabled"?: PtValue | undefined; "legend:errors"?: PtValue | undefined; "legend:warnings"?: PtValue | undefined; "legend:readonly"?: PtValue | undefined; "legend:hasValue"?: PtValue | undefined; "list:loading"?: PtValue | undefined; "list:disabled"?: PtValue | undefined; "list:errors"?: PtValue | undefined; "list:warnings"?: PtValue | undefined; "list:readonly"?: PtValue | undefined; "list:hasValue"?: PtValue | undefined; "indicator:loading"?: PtValue | undefined; "indicator:disabled"?: PtValue | undefined; "indicator:errors"?: PtValue | undefined; "indicator:warnings"?: PtValue | undefined; "indicator:readonly"?: PtValue | undefined; "indicator:hasValue"?: PtValue | undefined; "icon:hasValue"?: PtValue | undefined; "label:loading"?: PtValue | undefined; "label:hasValue"?: PtValue | undefined; "item:loading"?: PtValue | undefined; "item:errors"?: PtValue | undefined; "item:warnings"?: PtValue | undefined; "item:readonly"?: PtValue | undefined; "item:checked"?: PtValue | undefined; "item:focused"?: PtValue | undefined; "item:focusVisible"?: PtValue | undefined; "item:hasValue"?: PtValue | undefined; "itemDescription:loading"?: PtValue | undefined; "itemDescription:disabled"?: PtValue | undefined; "itemDescription:errors"?: PtValue | undefined; "itemDescription:warnings"?: PtValue | undefined; "itemDescription:readonly"?: PtValue | undefined; "itemDescription:checked"?: PtValue | undefined; "itemDescription:focused"?: PtValue | undefined; "itemDescription:focusVisible"?: PtValue | undefined; "itemDescription:hasValue"?: PtValue | undefined; } & { icon?: PtValue | PtItemFn<T, GroupPtState, never, { readonly item: T; }> | undefined; label?: PtValue | PtItemFn<T, GroupPtState, never, { readonly item: T; }> | undefined; item?: PtValue | PtItemFn<T, GroupPtState, never, { readonly item: T; }> | undefined; itemDescription?: PtValue | PtItemFn<T, GroupPtState, never, { readonly item: T; }> | undefined; } & { "indicator:pill"?: PtValue | undefined; "indicator:line"?: PtValue | undefined; "root:pill"?: PtValue | undefined; "root:line"?: PtValue | undefined; "icon:pill"?: PtValue | undefined; "icon:line"?: PtValue | undefined; "label:pill"?: PtValue | undefined; "label:line"?: PtValue | undefined; "item:pill"?: PtValue | undefined; "item:line"?: PtValue | undefined; "description:pill"?: PtValue | undefined; "description:line"?: PtValue | undefined; "message:pill"?: PtValue | undefined; "message:line"?: PtValue | undefined; "hint:pill"?: PtValue | undefined; "hint:line"?: PtValue | undefined; "legend:pill"?: PtValue | undefined; "legend:line"?: PtValue | undefined; "list:pill"?: PtValue | undefined; "list:line"?: PtValue | undefined; "itemDescription:pill"?: PtValue | undefined; "itemDescription:line"?: PtValue | undefined; }) | Passthrough, object form: the same keys as the |
pt:<part> Type: PtValue | ((ctx: PtItemCtx<T, GroupPtState, "pill" | "line">) => PtItemResult) | Passthrough, attribute form: one attribute per part, |
readonly Type: booleanDefaultfalse | Sets the input in a readonly state. The |
required Type: booleanDefaultfalse | Sets the input as required. The only group with this prop, because one value is either present or absent. It sets the native attribute and the marker (unless |
reverse Type: booleanDefaultfalse | Reverses the layout. Applicable in every direction the order of the label and the input is swapped. |
rules Type: RuleExpression<any> | vee-validate rules for this field. Only inside a Validates the chosen value as one field. Only inside a |
selectable Type: boolean | ((item: T) => boolean)Defaulttrue | 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 |
validationLabel Type: string | The field's name in validation messages ( |
validationMode Type: ValidationMode | When the field validates: |
variant Type: keyof RadioVariantRegistry | A tab-strip look (Q76.11 d): |
warnings Type: string | string[] | Warning messages under the field, a string or array: amber, in their own |
v-model
Values kept in sync through v-model.
| Name | Description |
|---|---|
modelValue Type: any | One resolved value, never an array. Seed it |
Events
| Name | Description |
|---|---|
active Type: (): void | Emitted when the group becomes active (focus/click enters it). |
blur Type: (event: FocusEvent): void | Emitted when one of the generated radio inputs loses focus. Forwards the original DOM |
change Type: (event: Event): void | Emitted when a radio option is selected. Forwards the original DOM |
click Type: (event: MouseEvent): void | Emitted when one of the generated radio inputs is clicked. Forwards the original DOM |
focus Type: (event: FocusEvent): void | Emitted when one of the generated radio inputs receives focus. Forwards the original DOM |
inactive Type: (): void | Emitted when focus/click moves outside the group after it was active. Useful for validation-on-blur flows at group level. |
input Type: (event: Event): void | Emitted on native input events from generated radio inputs. Forwards the original DOM |
keydown Type: (event: KeyboardEvent): void | Emitted for keyboard interaction on generated radio inputs. Forwards the original DOM |
mousedown Type: (event: MouseEvent): void | Emitted when a pointing device button is pressed over a radio input. Forwards the original DOM |
mouseup Type: (event: MouseEvent): void | Emitted when a pointing device button is released over a radio input. Forwards the original DOM |
update:modelValue Type: (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 | Description |
|---|---|
append Type: object | Content rendered after the last option, inside the options container. |
description Type: BbRadioGroupDescriptionSlotProps | Replaces the description text. Provided alone (no |
empty Type: { error: unknown; } | Content shown when no options are available (replaces the default "no data" text). |
icon Type: 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 Type: BbRadioGroupLabelSlotProps<T> | Replaces the default label text for each option. Scoped |
legend Type: BbRadioGroupLegendSlotProps | Replaces the default fieldset legend text for the group. |
loading Type: object | Content shown while options are loading (replaces the default loading text). |
prepend Type: object | Content rendered before the first option, inside the options container. |
Renamed and removed
Names from v2 and from earlier 3.0 betas that no longer work, and what to write instead.
colorremovedfails silentlydirectionlayoutfails silentlyhasWarninghasWarningsfails silentlyinputDirectionlistLayoutfails silentlylabelPositionlegendPositionfails silently- slot
no-dataemptyfails silently noDataTextemptyTextfails 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.