Small marks for status, priority, color and people.
BacklogTodoIn progressDoneCanceled
UrgentHighMediumLow
BugFeatureMCMaya ChenScout (agent)
import type { Html } from "@effect/ui/html"import * as stylex from "@stylexjs/stylex"import { type Glyph, GlyphView } from "./ui/uicontext/components/Glyph.ts"import { sx } from "./ui/uicontext/components/Sx.ts"import { color, font, space } from "./ui/uicontext/components/tokens.stylex.ts"const styles = stylex.create({ rows: { display: "grid", gap: space.lg }, row: { display: "flex", flexWrap: "wrap", columnGap: space.xl, rowGap: space.sm }, sample: { display: "inline-flex", alignItems: "center", gap: space.sm, fontSize: font.sm, color: color.fg },})const rows: ReadonlyArray<ReadonlyArray<{ readonly glyph: Glyph; readonly label: string }>> = [ [ { glyph: { _tag: "Ring", color: color.muted, progress: 0, dashed: true, label: "Backlog" }, label: "Backlog" }, { glyph: { _tag: "Ring", color: color.muted, progress: 0, label: "Todo" }, label: "Todo" }, { glyph: { _tag: "Ring", color: color.caution, progress: 0.5, label: "In progress" }, label: "In progress" }, { glyph: { _tag: "Ring", color: color.done, progress: 1, mark: "check", label: "Done" }, label: "Done" }, { glyph: { _tag: "Ring", color: color.muted, progress: 1, mark: "cross", label: "Canceled" }, label: "Canceled" }, ], [ { glyph: { _tag: "Bars", level: 3, alert: true, label: "Urgent" }, label: "Urgent" }, { glyph: { _tag: "Bars", level: 3, label: "High" }, label: "High" }, { glyph: { _tag: "Bars", level: 2, label: "Medium" }, label: "Medium" }, { glyph: { _tag: "Bars", level: 1, label: "Low" }, label: "Low" }, ], [ { glyph: { _tag: "Swatch", color: color.danger }, label: "Bug" }, { glyph: { _tag: "Swatch", color: color.info }, label: "Feature" }, { glyph: { _tag: "Person", id: "maya", name: "Maya Chen", agent: false }, label: "Maya Chen" }, { glyph: { _tag: "Person", id: "scout", name: "Scout", agent: true }, label: "Scout (agent)" }, ],]export const IssueGlyphs = <M>(h: Html.H<M>) => h.div.attrs(sx(styles.rows)).children( rows.map((row, i) => h.div.key(String(i)).attrs(sx(styles.row)).children( row.map(({ glyph, label }) => h.span.key(label).attrs(sx(styles.sample)).children(GlyphView(h, glyph), label)), )), )Installation
pnpm dlx shadcn@latest add checkfu/uicontext/glyphUsage
import { GlyphView } from "./ui/uicontext/components/Glyph.ts"import { color } from "./ui/uicontext/components/tokens.stylex.ts"export const InProgress = <M>(h: Html.H<M>) => GlyphView(h, { _tag: "Ring", color: color.caution, progress: 0.5, label: "In progress" })API reference
Options
| Name | Type | Description |
|---|---|---|
idrequired | string | A stable id, which picks the color, so one person keeps theirs everywhere. |
namerequired | string | The full name: the initials come from it, and it labels the avatar. |
agent | boolean | Draws an agent: a rounded square with the agent mark. |
image | string | A picture's URL, shown instead of the initials. |
Accessibility
- A ring or bars glyph is an image named by its
label, so a screen reader hears "In progress" or "High priority", not a shape. - An avatar shows initials, or a picture with empty
alt, and carries the name as a tooltip; say the name in text beside it where it matters. A swatch is decoration only.