Skip to content

MazBadge

MazBadge is a standalone component to show short text in colored container

INFO

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

Basic usage

Badge
vue
<template>
  <MazBadge>
    Badge
  </MazBadge>
</template>

<script lang="ts" setup>
  import MazBadge from 'maz-ui/components/MazBadge'
</script>

Options

See all options props here

Colors


primarysecondaryinfosuccesswarningdangerwhiteblackgraytheme
vue
<template>
  <MazBadge v-for="color in color" :key="color" :color="color">
    {{ color }}
  </MazBadge>
</template>

<script lang="ts" setup>
  import MazBadge from 'maz-ui/components/MazBadge'

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

Outline


primarysecondaryinfosuccesswarningdangerwhiteblackgraytheme
vue
<template>
  <MazBadge v-for="color in color" :key="color" :color="color" outline>
    {{ color }}
  </MazBadge>
</template>

<script lang="ts" setup>
  import MazBadge from 'maz-ui/components/MazBadge'

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

Pastel


primarysecondaryinfosuccesswarningdangerwhiteblackgraytheme
vue
<template>
  <MazBadge v-for="color in color" :key="color" :color="color" pastel>
    {{ color }}
  </MazBadge>
</template>

<script lang="ts" setup>
  import MazBadge from 'maz-ui/components/MazBadge'

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

Size


0.8rem 1.2rem 1.6rem 2rem 2.4rem
vue
<template>
  <MazBadge size="0.8rem">
    0.8rem
  </MazBadge>
  <MazBadge size="1.2rem">
    1.2rem
  </MazBadge>
  <MazBadge size="1.6rem">
    1.6rem
  </MazBadge>
  <MazBadge size="2rem">
    2rem
  </MazBadge>
  <MazBadge size="2.4rem">
    2.4rem
  </MazBadge>
</template>

<script lang="ts" setup>
  import MazBadge from 'maz-ui/components/MazBadge'
</script>

Rounded sizes


smmdlgxlfull
vue
<template>
  <MazBadge v-for="size in roundedSize" :key="size" :rounded-size="size" size="1.2rem">
    {{ size }}
  </MazBadge>
</template>

<script lang="ts" setup>
  import MazBadge from 'maz-ui/components/MazBadge'

  const roundedSize = ['sm', 'md', 'lg', 'xl', 'full']
</script>

Props & Slots

Props

Prop nameDescriptionTypeValuesDefault
colorBadgeColor-'primary'
sizestring-'0.8em'
nowrapboolean-false
outlineboolean-false
pastelboolean-false
roundedSizeBadgeRoundedSize-'md'

Slots

NameDescriptionBindings
default