Skip to content

Tag ​

A label for an active filter, a keyword or a selected value. It can have an icon and a remove button.

For a simple indicator (status, count), use Badge.

Usage ​

Variants ​

vue
<SuTag label="Approved" variant="success" />

Removable ​

The remove button is named "Remove {label}" and emits remove.

vue
<script setup>
import { ref } from 'vue'

const filters = ref(['Paris', 'Under $500', 'Free shipping'])
const remove = (filter) => (filters.value = filters.value.filter((f) => f !== filter))
</script>

<template>
  <SuTag v-for="filter in filters" :key="filter" :label="filter" removable @remove="remove(filter)" />
</template>

Sizes ​

vue
<SuTag size="sm" label="Small" removable />

API ​

Props ​

PropTypeDefaultDescription
labelstring-Label (or default slot)
variant'default' | 'primary' | 'success' | 'warning' | 'error' | 'info''default'Variant
size'sm' | 'md' | 'lg''md'Size
iconComponent-Icon before the label
removablebooleanfalseRemove button
removeLabelstring'Remove {label}' (locale)Remove button name
disabledbooleanfalseDisables the tag

Events ​

EventPayloadDescription
removeMouseEventRemove button clicked

Accessibility ​

  • The remove button is a real <button>, named with the tag label (read from the slot when the label prop is missing).
  • After a removal, move focus somewhere sensible (next tag, filter field): the removed button takes focus with it.
  • State tints use the --su-state-*-fg tokens, readable on their soft background.

Publié sous licence MIT.