Component reference
Pill
A capsule fact, or a native button when supplied an action.
Preview
Filters and status tags
24px pill buttons and 20px read-only tags; the caller owns the selection state.
render() {
const active = signal(true);
const pressed = signal("true");
return (
<Stack>
<Inline align="center">
<Pill
active={active}
aria-pressed={pressed}
onClick={() => {
active.value = !active.value;
pressed.value = String(active.value);
}}
>
Show running only
</Pill>
<Pill>Exit code 1</Pill>
<Pill onClick={() => {}} disabled>
Unavailable filter
</Pill>
<Button size="small">Refresh</Button>
</Inline>
<Inline>
{(
[
"outline",
"solid",
"neutral",
"quiet",
"success",
"accent",
"warning",
"danger",
] as const
).map((tone) => (
<Badge size="small" tone={tone}>
{tone}
</Badge>
))}
</Inline>
</Stack>
);
}Installation
bun add meowtail
Usage
Taken from the examples on this page.
import { Pill } from "meowtail";
<Pill>Exit code 1</Pill>API reference
Selection belongs to its caller.
Props
| Prop | Type | Default |
|---|---|---|
active | MaybeSignal<boolean> | false |
Also takes className, children and the attributes and events of its root element.
DOM parts
root
Registry
The component is registered as pill in the meowtail component registry.