Approval Workflow
motiq/approval-workflowFreeComponent
Display and control an app-owned approval process — sequential or parallel stages, required/optional reviewers, minimum approvals, current-user actions (approve / reject / request changes / comment / cancel / resubmit), decision history, and collapsing completed stages. The app owns authorization; the component surfaces app-provided disabled reasons. Status is icon + label; reduced-motion safe.
Live preview
live · rendered by the registry
Rendered by motiq on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.motiq.dev/r/approval-workflow.jsonSource
1"use client";23import * as React from "react";4import { motion, AnimatePresence, type Transition } from "motion/react";56import { cn } from "@/lib/utils";7import {8 useReducedMotion,9 getStatusMeta,10 statusVars,11 formatTimestamp,12 useDisclosure,13 streamItemVariants,14 type StatusTone,15} from "@/lib/motiq";1617/* --------------------------------------------------------------------------18 * ApprovalWorkflow — presentation + control for an app-owned approval/sign-off19 * process. The APPLICATION owns authorization: this component never decides20 * whether an action is permitted — it renders the state it is given and asks21 * the host (via `canAct`) whether each action is allowed, surfacing the host's22 * disabled reason in the UI. Supports sequential (all-must-approve) and23 * parallel (any-one / quorum) stages, minimum approvals, required vs optional24 * approvers, a current-user action state, a decision history, and destructive25 * reject confirmation. Clean-room original.26 * ----------------------------------------------------------------------- */2728export type ApprovalStatus =29 | "draft"30 | "pending"31 | "in_review"32 | "approved"33 | "rejected"34 | "changes_requested"35 | "cancelled"36 | "expired";3738export type ApprovalAction =39 | "approve"40 | "reject"41 | "request_changes"42 | "add_comment"43 | "cancel"44 | "resubmit";4546/** How a stage aggregates its reviewers' decisions. */47export type StageMode = "all" | "any" | "quorum";4849/** A reviewer's current decision on their stage. */50export type ReviewerDecision =51 | "pending"52 | "approved"53 | "rejected"54 | "changes_requested";5556export interface Person {57 /** Stable identity — drives keys, current-user matching, and avatar hue. */58 id: string;59 name: string;60 /** Optional role/title, e.g. "Security lead". */61 role?: string;62 /** Optional avatar image; when absent an initials + hue avatar is generated. */63 avatarUrl?: string;64 /** Optional explicit avatar color (any CSS color). */65 color?: string;66}6768export interface Reviewer extends Person {69 /** Optional approvers do not count toward `requiredApprovals`. */70 optional?: boolean;71 /** The reviewer's current decision on this stage. Defaults to "pending". */72 decision?: ReviewerDecision;73 /** When the decision was recorded. */74 decidedAt?: Date | number | string;75 /** A short note attached to the decision. */76 note?: string;77}7879export interface WorkflowStage {80 /** Stable id — drives keys and the `currentStageId` pointer. */81// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from motiq
All 100 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Activity Streamactivity-stream | motiq | Components | Free | 1 dep | |
| Adaptive Safe-Zone Gridadaptive-safe-zone-grid | motiq | Components | Free | no deps | |
| Agent Run Timelineagent-run-timeline | motiq | Components | Free | 1 dep | |
| AI Response Streamai-response-stream | motiq | Components | Free | 1 dep | |
| Animated Accordionanimated-accordion | motiq | Components | Free | 2 deps | |
| Animated Buttonanimated-button | motiq | Components | Free | 1 dep | |
| Animated Dialoganimated-dialog | motiq | Components | Free | 2 deps | |
| Animated Gridanimated-grid | motiq | Components | Free | 2 deps |
