Skip to content

MazRadioButtons

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

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>

Props

NameDescriptionTypeRequiredDefaultPossible values
model-valuev-model
TNoundefined-
optionsThe options to displayOption[]Yesundefined-
nameThe name of the radio groupstringNo'MazButtonsRadio'-
colorThe color of the selected radio buttonsMazColor | "background"No'primary'-
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.booleanNoundefined-
successWhether the input is successful.booleanNoundefined-
warningWhether there is a warning with the input.booleanNoundefined-
hintThe hint text to display below the input.stringNoundefined-
sizeThe size of the radio buttonsMazSizeNo'md'-

Events

Event namePropertiesDescription
update:model-valuevalue mixed - The value of the selected optionEmitted when the selected option change
changevalue mixed - The value of the selected optionEmitted when the selected option change
blurvalue FocusEvent - The focus eventEmitted when the a radio button lost focus
focusvalue FocusEvent - The focus eventEmitted when the a radio button is focused

Slots

NameDescriptionBindings
defaultLabel of the radiooption string | number | boolean - The value of the option
selected Boolean - If the option is selected