Skip to content

MazRadioButtons ​

MazRadioButtons is a standalone component to select a value in a list. Made with native HTMLInputElement type radio

Before use it, you should install the MazUi plugin in your project, follow instructions in Getting Started

Basic usage ​

Select a competition

Custom slot template ​

Select a competition

Orientation - Column ​

Select a competition

Selector icon with options equal-size ​

This option will display a select icon on the left of the label

Types ​

options ​

The options prop is an array of ButtonsRadioOption type

ts
export type ButtonsRadioOption = {
  /** The label of the option */
  label: string
  /** The value of the option */
  value: string | number | boolean
  /** The classes to apply to the option */
  classes?: any
  /** The style to apply to the option */
  style?: StyleValue
} & Record<string, unknown>

Accessibility ​

The root element is a radiogroup of native radio inputs: pass an aria-label (or aria-labelledby) to name it. The hint describes the group (aria-describedby) and error sets aria-invalid. The arrows move between the options natively.

When no name is provided, each instance gets a unique one, so two groups of the same page never share their radios.

Props ​

NameDescriptionTypeRequiredDefaultPossible values
model-valuev-model The value of the selected optionTNo--
optionsThe options to displayOption[]Yes--
nameThe name of the radio groupstringNoa unique name per instance-
colorThe color of the selected radio buttons"primary" | "secondary" | "accent" | "info" | "success" | "warning" | "destructive" | "contrast" | "transparent" | "surface"No"primary"'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'destructive' | 'contrast' | 'transparent' | 'surface'
elevationAdd elevation to the radio buttonsbooleanNofalse-
orientationThe orientation of the radio buttons"row" | "col"No"row"'row' | 'col'
wrapDisable the wrap of the radio buttonsbooleanNotrue-
equal-sizeMake all radio buttons the same sizebooleanNofalse-
selectorDisplay a selector iconbooleanNofalse-
blockThe component will be displayed in full widthbooleanNofalse-
errorWhether there is an error with the input.booleanNo--
successWhether the input is successful.booleanNo--
warningWhether there is a warning with the input.booleanNo--
hintThe hint text to display below the input.stringNo--
sizeThe size of the radio buttons"xs" | "sm" | "md" | "lg" | "xl" | "mini"No'md''xs' | 'sm' | 'md' | 'lg' | 'xl' | 'mini'

Events ​

Event namePayloadDescription
update:model-valuevalue: Option["value"]Emitted when the selected option change
blurvalue: FocusEventEmitted when the a radio button lost focus
changevalue: Option["value"]Emitted when the selected option change
focusvalue: FocusEventEmitted when the a radio button is focused

Slots ​

NameDescriptionBindings
defaultLabel of the radiooption Option - The value of the option
selected boolean - If the option is selected