Tag

Renders a tag, typically used for displaying labels, categories, or keywords.

Read more Read less

Usage

<.tag>Well-Trained</.tag>

With icon:

<.tag>
  Puppy
  <.icon><Heroicons.edit /></.icon>
</.tag>

With delete button:

<.tag>
  High Energy
  <.button
    phx-click="remove-tag"
    phx-value-tag="high-energy"
    aria-label="Remove tag"
  >
    <.icon><Heroicons.x /></.icon>
  </.button>
</.tag>
puppy
<.tag>
  puppy
</.tag>
small normal medium large
<.tag size="small">
  small
</.tag>
<.tag size="normal">
  normal
</.tag>
<.tag size="medium">
  medium
</.tag>
<.tag size="large">
  large
</.tag>
nil primary secondary info success warning danger
<.tag variant={nil}>
  nil
</.tag>
<.tag variant="primary">
  primary
</.tag>
<.tag variant="secondary">
  secondary
</.tag>
<.tag variant="info">
  info
</.tag>
<.tag variant="success">
  success
</.tag>
<.tag variant="warning">
  warning
</.tag>
<.tag variant="danger">
  danger
</.tag>
nil pill
<.tag shape={nil}>
  nil
</.tag>
<.tag shape="pill">
  pill
</.tag>