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.
<o-tag></o-tag>
Props
Prop name | Description | Type | Values | Default |
---|---|---|---|---|
ariaCloseLabel | Accessibility label for the close button | string | - | From config: tag: { |
badge | Enable badge style | boolean | - |
|
closeIcon | Close icon name | string | - | From config: tag: { |
closeIconPack | Icon pack to use for the close icon | string | mdi , fa , fas and any other custom icon pack | From config: tag: { |
closeable | Add close/delete button to the item | boolean | - | false |
hoverable | The tag element will react to the hover states | boolean | - | From config: tag: { |
icon | Adds an icon to the left of the tag. | string | - | |
iconPack | Icon pack to use | string | mdi , fa , fas and any other custom icon pack | From config: tag: { |
label | Tag label, unnecessary when default slot is used | string | - | |
override | Override existing theme classes completely | boolean | - | |
rounded | Enable rounded style | boolean | - | From config: tag: { |
size | Size of the control | string | small , medium , large | From config: tag: { |
variant | Color variant of the breadcrumb | string | primary , info , success , warning , danger , and any other custom color | From config: tag: { |
Events
Event name | Properties | Description |
---|---|---|
close | event Event - native event | on close icon click event |
Slots
Name | Description | Bindings |
---|---|---|
default | Override the tag label | |
close | Override the close icon | close close() - close function |
Class Inspector
Class prop | Description | Props | Suffixes | |
---|---|---|---|---|
rootClass | Class of the root element. | |||
sizeClass | Class of the root element with size. | size | small | |
variantClass | Class of the root element with variant. | variant | primary | |
badgeClass | Class of the root element when badge style. | badge | ||
roundedClass | Class of the root element when rounded. | rounded | ||
hoverableClass | Class of the root element when hoverable. | hoverable | ||
labelClass | Class of the label element. | |||
iconClass | Class of the item icon element. | icon | ||
closeClass | Class 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.