Work parts
The pieces the kanban, task list and gantt share: a group head with its count, the grey well, a white card, a drop hole and a property row.
Installation
pnpm add @heyramzi/uiUsage
import {
GroupHead,
PropertyRow,
WorkCard,
WorkWell,
workLooks,
} from "@heyramzi/ui/components/work-parts";<GroupHead label="In progress" hue="var(--color-info)" count={1} onAdd={addTask} />
<WorkWell hue="var(--color-info)">
<WorkCard>
Send the signed SOW to the client
{#snippet meta()}<span>Oct 28</span>{/snippet}
</WorkCard>
</WorkWell>
<PropertyRow label="Assignee">Ada</PropertyRow>Keyboard and accessibility
- GroupHead's plus button is named by the add label and the group, like "Add: In progress".
- PropertyRow is a group named by its label, so the value is read with its label even where a narrow row hides it.
- WorkCard and WorkWell take no focus. Put a button or a link in a card that opens something.
API reference
WorkWell
huestring- Any CSS colour. Tints the well only while something is held over it.
activeboolean- Default
false - Something is held over the well.
childrenrequiredSnippetclassstring...rest- Every prop of
HTMLAttributes<HTMLDivElement>fromsvelte/elements
| Prop | Type | Default |
|---|---|---|
hue Any CSS colour. Tints the well only while something is held over it. | string | |
active Something is held over the well. | boolean | false |
children required | Snippet | |
class | string | |
...rest | Every prop of HTMLAttributes<HTMLDivElement> from svelte/elements | |
GroupHead
labelstringtitleSnippet- Drawn in place of `label`, in the caller's own type, for a head whose name is markup.
huestring- The status colour of the dot. Leave out for no dot.
countnumber- Leave out for no count chip.
onAdd() => void- Shows a plus at the end that adds an item to this group.
addLabelstring- Default
"Add" childrenSnippet- Extra controls before the plus.
classstring
| Prop | Type | Default |
|---|---|---|
label | string | |
title Drawn in place of `label`, in the caller's own type, for a head whose name is markup. | Snippet | |
hue The status colour of the dot. Leave out for no dot. | string | |
count Leave out for no count chip. | number | |
onAdd Shows a plus at the end that adds an item to this group. | () => void | |
addLabel | string | "Add" |
children Extra controls before the plus. | Snippet | |
class | string |
WorkCard
metaSnippet- The bottom row: dates, subtasks, time, avatars.
childrenrequiredSnippetclassstring...rest- Every prop of
HTMLAttributes<HTMLElement>fromsvelte/elements
| Prop | Type | Default |
|---|---|---|
meta The bottom row: dates, subtasks, time, avatars. | Snippet | |
children required | Snippet | |
class | string | |
...rest | Every prop of HTMLAttributes<HTMLElement> from svelte/elements | |
PropertyRow
labelrequiredstringiconComponent<{ class?: string; "aria-hidden"?: boolean | "true" | "false" }>- A Phosphor icon before the label.
layout"row" | "responsive"- Default
"row" - `responsive`: the label hides in a narrow container (a chip row) and shows as a column from `@3xl` up. `row`: always icon, label, value.
childrenrequiredSnippetclassstring
| Prop | Type | Default |
|---|---|---|
label required | string | |
icon A Phosphor icon before the label. | Component<{ class?: string; "aria-hidden"?: boolean | "true" | "false" }> | |
layout `responsive`: the label hides in a narrow container (a chip row) and shows as a column from `@3xl` up. `row`: always icon, label, value. | "row" | "responsive" | "row" |
children required | Snippet | |
class | string |
CountChip
countrequirednumbersize"sm" | "md"- Default
"md" - `sm` is 16px, for a count inside a control or on a button; `md` is 20px, beside a heading.
tone"neutral" | "brand"- Default
"neutral" - `brand` marks a count that is on: an applied filter, the selected segment.
classstring...rest- Every prop of
HTMLAttributes<HTMLSpanElement>fromsvelte/elementsexceptchildren, class
| Prop | Type | Default |
|---|---|---|
count required | number | |
size `sm` is 16px, for a count inside a control or on a button; `md` is 20px, beside a heading. | "sm" | "md" | "md" |
tone `brand` marks a count that is on: an applied filter, the selected segment. | "neutral" | "brand" | "neutral" |
class | string | |
...rest | Every prop of HTMLAttributes<HTMLSpanElement> from svelte/elements except children, class | |