Skip to content

Badge

EBadge is used to enhance the content with further information and emphasize an item's status for quick recognition. Demo Here

Usage

vue

<template>
  <EBadge>
    <template #element>
      <EAvatar src="image_source"/>
    </template>
    <template #content>+999</template>
  </EBadge>
</template>

Props

For EBadge component, the following props are available:

PropTypeDefaultNote
roundedBooleanfalseIt creates a circular badge.
widthString-Sets the badge element's width.
badgeWidthString-Sets the badge content's width.
heightString-Sets the badge element's height.
badgeHeightString-Sets the badge content's height.
borderWidthString_Sets the badge border's width.
badgeClassesString""Overrides or extends the badge styles.
squareBooleanfalseRemoves rounded corners of the element.
sizeString"md"The EBadge element has three predefined sizes: sm, md, lg.
topString-Specifies the top position of an element in combination with the position property.
leftString-Specifies the left position of an element in combination with the position property.
rightString-Specifies the right position of an element in combination with the position property.
bottomString-Specifies the bottom position of an element in combination with the position property.
statusBooleanfalseDisplays a badge without any content used for showing profile status (e.g offline,online, etc.)
colorString"primary"The given color is applied to the badge - utility colors are supported (e.g primary or danger). you'll find a list of built-in classes on the src/styles/_vars.scsspage.
variantString"fill"The EBadge element can be represented in two ways: default, shadow and border. shadow displays the badge with a light shadow. border applies a 1.5px border around the badge.
positionStringtop-rightThe position prop allows the badge to be position relative to the activator. The badge can appear from the top-right, bottom-right,top-left or bottom-left edge of the element.
iconObject-Inserts a custom EIcon element to the badge content. More Info here

Slots

The EBadge component provides following slots that enable you to customize the content.

SlotDescription
elementThe slot used for the badge's element.
contentThe slot used for the badge's content.

COPYRIGHT