Skip to content

Tag

The Tag component (also known as Badge) is a small but versatile element. It's very useful as a way to attach information to a block or other components. Its size makes it also easy to display in numbers, making it appropriate for long lists of items.

Examples

Base

Closable

Closable tags have a button that can be focused, it emits a close event when clicked. The button can be overriden by the close slot.

Badge

Using the badge style with the badge prop can highlight information to a user or draw their attention to a specific element. Badges typically display numbers or icons.

Variants

Like with buttons, different styles can be achieved with the variant prop.

Sizes

The component can also be displayed in different sizes using the size prop.

Tag component

Small tag labels to insert anywhere.

html
<o-tag></o-tag>

Props

Prop nameDescriptionTypeValuesDefault
ariaCloseLabelAccessibility label for the close buttonstring-
From config:
tag: {
  ariaCloseLabel: "Close"
}
badgeEnable badge styleboolean-
closeIconClose icon namestring-
From config:
tag: {
  closeIcon: undefined
}
closeIconPackIcon pack to use for the close iconstringmdi, fa, fas and any other custom icon pack
From config:
tag: {
  closeIconPack: undefined
}
closeableAdd close/delete button to the itemboolean-false
hoverableThe tag element will react to the hover statesboolean-
From config:
tag: {
  hoverable: false
}
iconAdds an icon to the left of the tag.string-
iconPackIcon pack to usestringmdi, fa, fas and any other custom icon pack
From config:
tag: {
  iconPack: undefined
}
labelTag label, unnecessary when default slot is usedstring-
overrideOverride existing theme classes completelyboolean-
roundedEnable rounded styleboolean-
From config:
tag: {
  rounded: false
}
sizeSize of the controlstringsmall, medium, large
From config:
tag: {
  size: undefined
}
variantColor variant of the breadcrumbstringprimary, info, success, warning, danger, and any other custom color
From config:
tag: {
  variant: undefined
}

Events

Event namePropertiesDescription
closeevent Event - native eventon close icon click event

Slots

NameDescriptionBindings
defaultOverride the tag label
closeOverride the close iconclose close() - close function

Class Inspector

Classes applied to the element:
Class propDescriptionPropsSuffixes
rootClassClass of the root element.
sizeClassClass of the root element with size.sizesmall
medium
large
variantClassClass of the root element with variant.variantprimary
info
warning
danger
badgeClassClass of the root element when badge style.badge
roundedClassClass of the root element when rounded.rounded
hoverableClassClass of the root element when hoverable.hoverable
labelClassClass of the label element.
iconClassClass of the item icon element.icon
closeClassClass of the tag item close button element.closeable

Sass variables

Current theme ➜ Oruga

The theme does not have any custom variables for this component.

Current theme ➜ Bulma

The theme does not have any custom variables for this component.

Current theme ➜ Bootstrap

The theme does not have any custom variables for this component.

Released under the MIT License.