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
T-undefined
valueThe value of the radioT-
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
errorWhether there is an error with the input.boolean-
successWhether the input is successful.boolean-
warningWhether there is a warning with the input.boolean-
hintThe hint text to display below the input.string-

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
blurvalue FocusEvent - The focus eventEmitted when the radio lost focus
focusvalue FocusEvent - The focus eventEmitted when the radio is focused

Slots

NameDescriptionBindings
default