Skip to content

MazRadio

MazRadio is a standalone component

INFO

Before you have to import the global css files in your project, follow instructions in Getting Started

Basic usage

v-model="undefined"

View code
vue
<template>
  <MazRadio
    v-for="color in colors"
    v-model="chosenColor"
    name="chosenColor"
    :color="color"
    :key="color"
    :value="color"
  >
    {{ color }}
  </MazRadio>
</template>

<script lang="ts" setup>
  import { ref } from 'vue'
  import MazRadio from 'maz-ui/components/MazRadio'

  const chosenColor = ref('primary')
  const chosenSize = ref('mini')

  const colors: Color[] = [
    'primary',
    'secondary',
    'info',
    'success',
    'warning',
    'danger',
    'white',
    'black',
  ]
</script>

Sizing

v-model="undefined"

View code
vue
<template>
  <MazRadio
    v-for="size in sizes"
    v-model="chosenSize"
    name="chosenSize"
    :key="size"
    :size="size"
    :value="size"
    :label="size"
  />
</template>

<script lang="ts" setup>
  import { ref } from 'vue'
  import MazRadio, { type Size } from 'maz-ui/components/MazRadio'

  const chosenSize = ref('mini')

  const sizes: Size[] = ['mini', 'xs', 'sm', 'md', 'lg', 'xl']
</script>

Disabled

Props, Event & Slots

Props

Prop nameDescriptionTypeValuesDefault
styleStyle attribut of the component root elementTSIndexedAccessType-undefined
classClass attribut of the component root elementTSIndexedAccessType-undefined
idThe id of the radiostring-undefined
modelValue
@model The value of the radio
union-undefined
valueThe value of the radiounion-
nameThe name of the radiostring-
labelThe label of the radiostring-undefined
colorThe color of the radioColor-'primary'
sizeThe size of the radioSize-'md'
disabledThe disabled state of the radioboolean-false

Events

Event namePropertiesDescription
update:model-valuevalue string | number | boolean - selected valueEvent emitted when value change
changevalue string | number | boolean - selected valueEvent emitted when value change

Slots

NameDescriptionBindings
defaultLabel of the radiois-selected Boolean - If the radio is selected
value string | number | boolean - The value of the radio