Priority Icon
A flag marking priority — urgent, high, medium, low and none — in semantic colours, the sibling of Status Icon.
- Status
- Since
0.23.11- Accessibility pattern
- img role with derived label
Last updated
Install
Add Priority Icon from the VegaStack registry. The CLI verifies the item's integrity hash before writing it.
pnpm dlx shadcn@latest add @vegastack/priority-iconUsage
import { PriorityIcon } from "@/components/ui/priority-icon";
<PriorityIcon priority="high" size="sm" />;Examples
Levels
A lucide Flag per level: urgent (filled, destructive), high (filled, warning), medium
(filled, info), low (outline, muted) and none (dashed outline, muted). The fill backs up the
colour so the level never rests on colour alone.
Sizes
The same xs (14px), sm (16px), md (20px) and lg (24px) steps as StatusIcon.
Every level at every size:
Priority menu recipe
Compose DropdownMenu + PriorityIcon + DropdownMenuShortcut — there is no picker component.
While the menu is open, 1 / 2 / 3 / 4 / 0 pick Urgent / High / Medium / Low /
No priority.
<DropdownMenu open={open} onOpenChange={setOpen}>
<DropdownMenuTrigger
render={
<Button
variant="ghost"
size="icon-sm"
aria-label={`Priority: ${label}`}
/>
}
>
<PriorityIcon priority={priority} size="sm" label="" />
</DropdownMenuTrigger>
<DropdownMenuContent onKeyDown={pickByShortcut}>
{PRIORITIES.map((p) => (
<DropdownMenuItem key={p.value} onClick={() => setPriority(p.value)}>
<PriorityIcon priority={p.value} size="sm" label="" />
{p.label}
<DropdownMenuShortcut>{p.key}</DropdownMenuShortcut>
</DropdownMenuItem>
))}
</DropdownMenuContent>
</DropdownMenu>In Select and Combobox options
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | Accessible label. Defaults to e.g. "High priority". Pass "" to make the icon decorative
(aria-hidden) when adjacent text already states the priority. |
priority | "high" | "low" | "medium" | "none" | "urgent" | 'none' | Priority to display, on a lucide Flag:
- urgent → filled, text-destructive-text
- high → filled, text-warning-text
- medium → filled, text-info-text
- low → outline, text-muted-foreground
- none → dashed outline, text-muted-foreground |
size | "lg" | "md" | "sm" | "xs" | 'md' | Size variant: xs (14px), sm (16px), md (20px), lg (24px). |
Data attributes and CSS variables on PriorityIcon
| Attribute | Values |
|---|---|
data-icon-tone | "" |
data-priority | mirrors a prop or state value |
data-size | mirrors a prop or state value |
data-slot | "priority-icon" |
Accessibility
- Renders
role="img"with anaria-labelsuch as"High priority"; override withlabel. - Pass
label=""when adjacent text names the priority, making the icon decorative (aria-hidden). - Filled, outline and dashed fills distinguish the levels without relying on colour.
| Concern | Behavior |
|---|---|
| Role | role="img" unless label="" (decorative, aria-hidden) |
| Accessible name | aria-label from label, or a default derived from priority |
| Contract | States tested |
|---|---|
| Behaviour | default, empty, error, success |
| Accessibility | labeled |
| Visual | default, error, success, empty |