Skip to content

Tags - AvTag

✨ Introduction

The AvTag categorizes/classifies/organizes content using keywords. They help users easily search for and find information.

The tag can be used as a filter (in a search results page, for example). In this case, it can be:

  • activated as a filter to be selected/deselected;
  • deleted; serves as a reminder of a filter that has been checked in a sidebar or drop-down list.

🏗️ Structure

It consists of the following elements:

  • a mandatory label: either using the prop label;
  • an optional icon: the name of an @iconify/vue icon.

🏷️ Props

NameTypeDefaultMandatoryDescription
labelstringDisplayed tag label.
linkstringURL for external link. Also determines the tag type (a or RouterLink).
tagName'p' | 'button''p'Tag name used for the tag (should be 'p' or 'button').
iconstringIcon to display in the tag. Can be a name or an icon configuration.
disabledbooleanfalseDisables the tag if it is a button.
smallbooleanfalseDisplays the tag in a small version.
iconOnlybooleanfalseDisplays the tag in icon-only version.
selectablebooleanfalseMakes the tag selectable. When true, additional props are available.
selectedbooleanIndicates if the tag is selected. (Available if selectable is true)
valueTTag value (useful in a selectable tags list). (Available if selectable is true)

🔊 Events

NameData (payload)Description
'select'T[]Event emitted when a selectable tag is (un)selected. This updates the selected values list.

🎨 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>
  <AvTag
    label="Some tag"
    :icon="MDI_ICON.PENCIL_OUTLINE"
  />
</template>