Data display
Layout
Tag
A compact label that categorizes or annotates an item inline. Use it for statuses, categories and keywords.
Install
import { Tag } from 'vael-ui'Playground
Tag
muted
undefined
Usage
<script setup lang="ts">
import { Tag } from 'vael-ui'
</script>
<template>
<Tag>Tag</Tag>
</template>Motion New
Tag: its appearance and press states.
<Tag
:motion="{ states: { focus: { root: { scale: 1.04 } } } }"
/>| Name | Type | Description |
|---|---|---|
initialexit | root | Sets where each part comes in from and leaves to: any CSS property, plus x, y and blur. A plain number is px, or degrees for rotate. |
states | focusactivehover | Sets values per part that hold while a state is on. An array is a set of keyframes that plays once as the state turns on, such as a shake on invalid. |
enterleave | (parts, context) => animation | Animates the parts with GSAP, motion or element.animate(). Return the animation and the component waits for it, and stops it if interrupted. |
springdurationeasing | { damping, response } | number | string | Times all of it: a spring, or a duration in ms with an easing. Never both. |
false | boolean | Turns its motion off, for an animation of your own on its exposed elements. |
Accessibility
It has no keyboard interaction of its own.
- Tag is a
<span>with no role and no keyboard handling. - The
#iconslot isaria-hidden, so keep the meaning in the label. - A
@clickortabindexyou add gives it the press look only. Use a Button for actions.