WlPill
Appearance
Full example
<div class="wl-stack" data-space="md">
<WlPill label="In progress" />
</div>Content
Full example
<div class="wl-stack" data-space="md">
<WlPill label="In progress" />
</div>Five statuses
Neutral/info/ok/warn/err, label and a custom default slot with a decorative icon.
A status displays a state and performs no action. Its label is understandable without color.
Full example
<script setup lang="ts">
import { WlIcon, WlPill, type WlTone } from "legato-ui";
const labels = { neutral: "Draft", accent: "Release", info: "In progress", success: "Done", warning: "Needs review", danger: "Error" } satisfies Record<WlTone, string>;
</script>
<template>
<div class="wl-stack" data-space="lg">
<div class="wl-inline" data-space="sm"><WlPill
v-for="(label, variant) in labels"
:key="variant"
:label="label"
:tone="variant"
/></div>
<div class="wl-inline" data-space="sm">
<span class="wl-text-body">{{ "Default-slot content:" }}</span>
<WlPill tone="success"><WlIcon name="check" :size="12" />{{ "Reviewed by the team" }}</WlPill>
</div>
<p class="wl-text-small wl-text-muted">{{ "A status displays a state and performs no action. Its label is understandable without color." }}</p>
</div>
</template>Props
Types, accepted values and literal defaults come from the public manifest. Inherited settings name their source; “Not set” means no default is declared.
| Prop | Type / values | Default | Purpose |
|---|---|---|---|
tone | WlTone | "neutral" | Semantic status color. |
label | string | Not set | Text (when no slot is provided). |
dot | boolean | true | Display a compact status dot. |
pt | WlPt< | Not set | Attributes and callbacks for the component's documented pass-through sections. |
Events
No public events.
Slots
| Slot | Type / values | Content |
|---|---|---|
default | — | Custom text instead of label. |
Pass-through: pt
Sections WlPill are listed below. Attributes merge in this order: createWlPt() WlConfig.ptpt instance. Class and style merge; the last supplied value takes priority for other attributes.
| Section | DOM | Purpose |
|---|---|---|
root | span.wl-pill | Main element of the component. |
dot | span.wl-pill__dot | Decorative status dot. |
label | span | Visible component label. |
Sections refer to the component DOM. Dotted names identify a configuration group and its section; composite parts use their own pt groups. Global and local attributes merge, with class and style added together.
Keyboard and accessibility
- Label or the default slot explains status independently of tone colour.
- Pill is static text; use a separate button or link for actions.
- Keep decorative icons hidden from assistive technology; announce important status changes in a suitable application live region.
Keyboard and application responsibilities
Provide a meaningful accessible name and connect labels, hints and errors to the focusable element. Check the behavior with your own data and a screen reader.
WAI-ARIA Authoring PracticesIn your application, check keyboard controls, zoom and focus visibility. State labels and required information must be readable in every theme.