Skip to content
Component installs need the registry setup
VegaStack Design

Priority Icon

A flag marking priority — urgent, high, medium, low and none — in semantic colours, the sibling of Status Icon.

Status
stable
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-icon

Usage

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

PropTypeDefaultDescription
labelstring—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

AttributeValues
data-icon-tone""
data-prioritymirrors a prop or state value
data-sizemirrors a prop or state value
data-slot"priority-icon"

Accessibility

  • Renders role="img" with an aria-label such as "High priority"; override with label.
  • 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.
ConcernBehavior
Rolerole="img" unless label="" (decorative, aria-hidden)
Accessible namearia-label from label, or a default derived from priority
ContractStates tested
Behaviourdefault, empty, error, success
Accessibilitylabeled
Visualdefault, error, success, empty

Do / Don't

Do
Show the flag beside a record's title or in a picker option, with the menu recipe for changes.
Don't
Use the flag for status or severity messages — use StatusIcon, Badge or Alert.

On this page