Skip to content

Badges - AvBadge

✨ Introduction

The AvBadge is ideal for displaying short, important information, such as categories, labels, or statuses.

🏗️ Structure

  • The component is a p element with the av-badge class.
  • Props allow you to modify the badge appearance according to the props: color, icon presence, size, and handling of overly long text.
  • The label is displayed inside a span, potentially with the ellipsis prop and a defined or maximum size to handle truncated text.

🏷️ Props

NameTypeDefaultMandatoryDescription
colorstringThe color of the text to display in the badge.
backgroundColorstringThe background color of the badge.
borderColorstringThe color of the badge border.
iconstringThe name of the icon or the base64 icon to be displayed. You can use the MDI_ICONS, RI_ICONS, and ICONS_DATA_URL constants from DSAV.
labelstringThe text to display in the badge.
smallbooleanfalseIf true, displays a reduced-size badge.
ellipsisbooleanfalseIf true, the text is truncated with an ellipsis if it is too long.

🔊 Events

None.

🎨 Slots

None.

🚀 Storybook demos

You can find examples of use and demo of the component on its dedicated Storybook page.

💡 Examples of use

vue
<template>
  <AvBadge
    label="In progress"
    color="var(--dark-background-primary1)"
    background-color="var(--light-background-primary2)"
    :icon="ICON_DATA_URL.MDI_CALENDAR_CHECK_OUTLINE"
    small
  />
</template>