Reported as abusive · 5
[Message hidden while it is reviewed — contains a personal attack on another member.]
SIG—14 Signature system
Decisions at the speed of a gesture: fling the top card toward a decision, or use arrows and buttons — with tallies and an undo that flies the card back.
Fling the top card toward a decision, or use the arrow keys or buttons. Backspace undoes — the card flies back from where it went. Illustrative content.
01 / 05
Reported as spam · 3
Selling 40% off accounts for your favourite design tools, message me for the link!!
Left arrow: Remove. Right arrow: Keep. Up arrow: Escalate. Backspace undoes.
"use client";
import { TriageDeck } from "mizu-ui";
export function Example() {
return (
<TriageDeck
label="Inbox"
items={[
{ id: "a", title: "Invoice from Northworks" },
{ id: "b", title: "Team offsite dates" },
]}
itemLabel={(m) => m.title}
decisions={[
{ id: "archive", label: "Archive", direction: "left" },
{ id: "keep", label: "Keep", direction: "right", tone: "success" },
]}
renderItem={(m) => <h3 style={{ margin: 0, fontSize: 24 }}>{m.title}</h3>}
/>
);
}
It starts with "use client" because it keeps state or passes functions to components, so it pastes into a Next.js page as it is. Other React setups ignore the directive.
This code, running — no configuration beyond the data
01 / 02
Left arrow: Archive. Right arrow: Keep. Backspace undoes.
Add this component to your project with the shadcn CLI. The command copies its source into your configured UI directory, with base.css, Mizu’s tokens, and the stylesheets that hold its rules. Each rule lives in one stylesheet, so components you add together never repeat CSS. In a project without a components.json, run npx shadcn@latest init 0xuser64bit/mizu/preset first: plain init installs shadcn’s theme into your global CSS. Then load the fonts.
npx shadcn@latest add 0xuser64bit/mizu/triage-deckEvery component imports from its own path, its name in kebab case. To paste the example, replace its mizu-ui import with:
import { TriageDeck } from "@/components/ui/mizu/triage-deck";For npm imports, import mizu-ui/styles.css once. Fonts are optional via mizu-ui/fonts.css. Override --mizu-* tokens or use className for local styling. Requires React and Motion. A Client Component: its source starts with “use client”.
Source is included in the npm package under src/signature/TriageDeck.tsx.
| Prop | Type | Default | Description |
|---|---|---|---|
| label / items / renderItem | string / T[] / (item) => ReactNode | — | Region name, the queue (each with an id) and a card body. |
| itemLabel | (item) => string | — | A short name used in announcements and the deck's label. |
| decisions | TriageDecision[] | — | id, label, direction (left, right or up — one each) and tone. |
| onDecide / onUndo | (item, decision) => void | — | Record or reverse a decision. |
| empty | ReactNode | — | Shown when every item has been decided. |
The deck is a focusable group named after the current item and its position. Arrow keys make the decisions a fling would; every decision also has a labelled button with its key, and Backspace undoes. Each decision announces what happened and what comes next. Tallies are a labelled list.
The top card follows your hand and tilts with it; decision stamps fade in as you cross a threshold, and release velocity carries it off. The next card steps forward in depth, and an undone card flies back from the side it left by. Reduced motion decides without flight or tilt.