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 and fights 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 Wired into the input's |
disabled Type: booleanDefaultfalse | 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 Type: string | string[] | Error messages under the field, a string or array, in an Lives on one button, while the error usually belongs to the whole set. Put it on a single radio, the last, rather than on each one: repeated, it renders and announces the same sentence per button. A |
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. |
hint Type: string | Text box to be displayed near the input, usually to indicate instructions. |
id Type: string | The |
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. |
label requiredType: 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 |
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: |
modelValue Type: any | Used by v-model. Can be any serializable type. |
name Type: string | Name of the input. Optional: a generated one is unique to this radio, so radios that form ONE exclusive group must 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 Type: booleanDefaultfalse | Keeps the hint displayed. |
pt Type: PtMap<TogglePtPart, TogglePtState> | 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. Blocks changes while staying focusable and still submitting. A lone radio cannot announce it ( |
required Type: booleanDefaultfalse | Sets the input as required. |
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 a v2 |
value requiredType: 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 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 model shared by every button in the set: that is what makes selecting one deselect the rest. It carries the chosen |
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 radio selection 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 radio 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 when the radio becomes selected, carrying the radio's |
Slots
The listed properties are the ones exposed to the slot scope.
| Name | Description |
|---|---|
description Type: BbRadioDescriptionSlotProps | Replaces the description text. Provided alone (no |
icon Type: 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 Type: BbRadioLabelSlotProps | Replaces the default label text rendered next to the radio button. 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 silently