Tag <l-tag>
Tags are compact chips for tokens, filters, and selected values, with an optional remove button.
html
<l-tag removable>Design</l-tag>HTML tag
<l-tag>⏣Native
⬡Progressive
◇Plain
⬢Shadow-DOM
Shadow-DOM Custom Element
Options
Removable
Add removable for a × button. The user can also press Backspace or Delete while it is focused. Each removal fires a cancelable remove event; if nothing calls preventDefault(), the tag removes itself from the DOM.
Code
html
<div class="flex flex-wrap items-center gap-2">
<l-tag>Design</l-tag>
<l-tag>Development</l-tag>
<l-tag removable>Removable</l-tag>
</div>Sizes
Add size="sm" or size="lg". Default is md. A removable tag is always at least 24px tall to keep its remove target accessible.
Code
html
<div class="flex flex-wrap items-center gap-2">
<l-tag
size="sm"
removable
>Small</l-tag
>
<l-tag removable>Medium</l-tag>
<l-tag
size="lg"
removable
>Large</l-tag
>
</div>Leading content
Put an icon or avatar in the prefix slot.
Code
html
<div class="flex flex-wrap items-center gap-2">
<l-tag removable>
<l-icon
slot="prefix"
name="mdi:tag-outline"
></l-icon>
Marketing
</l-tag>
<l-tag removable>
<l-icon
slot="prefix"
name="mdi:account-outline"
></l-icon>
Jane Cooper
</l-tag>
</div>Disabled
Add disabled to block removal. The label stays legible — disabled is conveyed by the dimmed × button and the not-allowed cursor, not by washing out the text.
Code
html
<div class="flex flex-wrap items-center gap-2">
<l-tag
removable
disabled
>Locked</l-tag
>
</div>Accessibility
Criteria
Keyboard interactions
API reference
Importing
js
import 'luxen-ui/tag';Attributes & Properties
sizeTagSizedefault:'md'Property- Tag size:
sm,md(default), orlg. removablebooleandefault:falseProperty- Show a remove button (and enable Backspace/Delete removal).
disabledbooleandefault:falseProperty- Disable the tag — dims it and blocks removal.
Events
removecancelableEvent- Fired when the user removes the tag (× click or Backspace/Delete). Cancelable; if not prevented the tag removes itself. Not composed, does not bubble.