Bruno DelorenceBruno
Appearance
Appearance

Choose your reading theme.

Contact

Work orders

New

A property-operations board where a reported leak becomes a work order: filed, assigned, scheduled and completed in one place.

work-orders/work-orders.tsx
Live · interactive

Operations

Urgent

High

Normal

Request

Plumbing · Urgent

Water leaking through ceiling. Alder Court · B-306, reported 1h ago and not assigned yet.

Request

Status
New
Reported by
Priya Raman
Number
MR-3819

The live component, numbered part by part. Every measurement is read from it as it is drawn. Point at a row to outline its part, or at a part to find its row.

The choices it offers, each value drawn live and the default marked, with how to pick one.

When to use

  • Operations work that moves through a few fixed steps, each one a decision someone takes: a maintenance request that is assigned, scheduled and completed.
  • A queue people scan by urgency and then work through one item at a time, with the item’s state said in words next to the list.
  • Intake that starts small (where, what kind, how urgent, what is wrong) and grows into a record with a vendor, a date and costs.
  • A back office used on a phone as well as at a desk: under 640 px the list and the detail drill into each other.

When not to use

  • Free-form tasks with no fixed steps. Use a task list or a kanban board where people make their own columns.
  • Hundreds of rows to compare by many fields at once. Use a data table with sorting and filters.
  • A single form that ends when it is sent, as a public repair request from a tenant. Use a plain form page with a confirmation.
  • Steps that need several people to sign off. The board gives each step one button; approvals want their own flow with who and when.

The lifecycle

  • New: filed through the form; Not assigned in red, and the one next step is Assign to the vendor for its category.
  • Assigned: the work order opens with the vendor’s usual estimate, approved as it stands. The request shows it as a panel.
  • Scheduled: a visit two days out. The row moves from To schedule to Scheduled.
  • Completed: the actual cost shows, the row moves to Completed, and the toast says Work order completed.

Motion

  • Rows glide to their new group over 420 ms; a new request drops in with a blue tint that fades over 1.6 s.
  • The grey half of the title blurs in over 420 ms when it is rewritten; the ink half stays put.
  • A beat of skeleton, 320 ms, when a work order opens, as the page it stands for would load.
  • With reduced motion none of these play: the state changes at once, and the demo does not run.

Each one drawn with the component itself, used well or badly.

The words are the request’s problem, its place, the status words, the step buttons and the toasts.

  • The problem in the reporter’s words, sentence case, the first sentence of What is wrong, up to 80 characters: Dishwasher leaking onto the floor.
  • Buttons say the step and who: Assign to Ridgeline Plumbing, Schedule for Thu, Nov 5, Mark completed.
  • Status words are short and the same everywhere: Not assigned, Assigned, Scheduled, In progress, Waiting, Completed.
  • Toasts say what happened, in the past tense, without a full stop: Request MR-3820 created, Work order completed.

You can add this component with the shadcn CLI or by hand:

Into components/work-orders of any React project, with no setup:

Terminal
npx shadcn@latest add https://brunodelorence.com/r/work-orders.json

Either way it needs React 19.2 and a bundler that supports CSS Modules, such as Next.js or Vite. It has a dark colour scheme: it follows your page’s color-scheme, light unless the page sets one, or its colorScheme prop, with nothing to configure. Browsers without light-dark() show it light.

Usage

maintenance-board.tsx
'use client';import { WorkOrders, type LifecycleEvent } from './work-orders';export function MaintenanceBoard() {  const log = (event: LifecycleEvent) => console.log(event.type, event.id);  return <WorkOrders onLifecycle={log} autoplay={false} />;}

Each state below is a live instance, locked so you can study it.

The pieces it is built from, each with its measurements read live.

A maintenance board with a sidebar, a list of requests grouped by priority and a detail pane. File a new request in a dialog (property, unit, category, priority, what is wrong) and it drops into its group, unassigned. Its title is one sentence, the problem in ink and where it stands in grey, and every step rewrites the grey half: assign it to a vendor and a work order opens with an estimate, schedule the visit, mark it completed and the actual cost appears. In the work orders view the rows glide from group to group as they move along, and each step says so in a toast.

  • One record per request carries the whole lifecycle: new until it is assigned, then assigned, scheduled, in progress or waiting, completed, with the work order (vendor, estimate, approved, actual cost, visit) inside it. The list, the detail and the toasts are all read from that one array.
  • The title is two spans: the problem in ink and a status sentence in grey written from the record (“Ridgeline Plumbing at Alder Court · A-101, scheduled Thu, Nov 5.”). The grey span is keyed by its words, so a rewrite mounts it again and it blurs in from 4 px over 420 ms.
  • Rows that change group glide there with FLIP: after each change, every row’s top is measured in the list’s own px (scroll and any scale of the board taken out) and compared with the last one; a row that moved is played from its old place to its new one with the Web Animations API, 420 ms on cubic-bezier(0.2, 0.7, 0.2, 1).
  • A new request drops into its priority group with a blue tint that fades over 1.6 s; the group holding the chosen row is lifted onto a card; a work order panel and the actual cost card rise 6 px as they fade in over 320 ms; opening a work order shows 320 ms of skeleton.
  • The dialog is a modal inside the board, not over the page: the board behind it is inert, Tab loops round the form, Escape or the scrim closes it and the focus goes back to the button that opened it. An empty What is wrong keeps it open and marks the field.
  • The layout answers to the board’s own width with container queries: 172 px sidebar, 284 px list and the detail from 940 px; no sidebar below that; one column under 640 px, where choosing a row drills into it and a back button returns to the list.
  • While on screen and untouched, a demo pointer files the dishwasher leak (typing the unit and the problem), assigns it, opens its work order, schedules it and marks it completed, then starts over; any input from the reader stops it.
  • Every colour is a token on the root, light-dark() where the schemes differ: at night the board is near-black with graphite cards, the blue, red and orange lifted to keep their contrast. The sidebar’s Dark theme switch flips the board on its own.
PropTypeDefaultDescription
defaultState'browse' | 'dialog' | 'new' | 'assigned' | 'scheduled' | 'completed''browse'Where the board starts: browsing, with the New request form open, or with the dishwasher leak filed and at one of its steps. A still for docs and screenshots; anything but browse turns the demo off.
onLifecycle(event: LifecycleEvent) => void—Called after each step the reader takes, with its type (created, updated, assigned, scheduled, completed) and the request’s number.
autoplaybooleantrueWhile on screen and untouched, a demo pointer takes a leak from report to completed. Never under reduced motion; the first real input stops it.
colorScheme'light' | 'dark' | 'system'—Light or dark colours, or the reader’s; without it, the page’s color-scheme.
classNamestring—A class for the board.

Keyboard

  • The list is one tab stop: Up and Down, Home and End move between rows across the groups, Enter opens one.
  • New request opens the form with the focus on Property; Tab and Shift+Tab go round the form; Escape or Cancel closes it and the focus goes back to the button that opened it.
  • Sending an empty What is wrong keeps the form open, marks the field invalid and puts the focus on it with the message under it.
  • After a step the focus stays on the primary button, which now offers the next step; opening a request or a work order moves the focus to its title.

Screen readers

  • The form is a dialog with aria-modal, named by its title; the board behind it is inert.
  • Each step is announced in a polite live region, with the same words as its toast (“Assigned to Ridgeline Plumbing”); the toasts themselves are hidden from screen readers so it is said once.
  • The chosen row has aria-current; the facts are a description list; the view switch is two buttons with aria-pressed.

Colour and contrast

Not assigned is said in words as well as in red, and the alert dots sit beside words. Small grey text is at least 4.5 : 1 on the board and the cards in both schemes; the grey half of the title is large text at 3 : 1 or more. White on the primary blue is above 4.5 : 1.

In this build

  • The list is one Tab stop: Up, Down, Home and End move through the rows across groups, Enter opens one; the chosen row has aria-current.
  • New request opens a dialog (role="dialog", aria-modal, named by its title) with the focus on its first field; the board behind is inert, Tab loops inside, Escape closes, and the focus returns to the opener.
  • An empty What is wrong is marked aria-invalid, described by its message, and focused.
  • Each step is announced in a polite live region with the words of its toast; the toasts are hidden from screen readers so nothing is read twice.
  • After a step the focus stays on the primary button, which now offers the next step; opening a request or a work order, or drilling in on a narrow board, moves the focus to its title.
  • Status is said in words, never by colour alone; small text is at least 4.5 : 1 in both schemes. With reduced motion the glides, blurs, tints and skeleton are dropped and the demo does not play.

The complete source behind this demo. Open source under the MIT license, © 2026 Bruno Delorence: copy it, change it, ship it.

work-orders.tsx
// Copyright (c) 2026 Bruno Delorence. MIT License.'use client';import {  useEffect,  useEffectEvent,  useLayoutEffect,  useRef,  useState,  type KeyboardEvent as ReactKeyboardEvent,  type ReactNode,} from 'react';import {  ORDER_GROUPS,  PRIORITIES,  REQUEST_WORD,  SEED,  STAGE_WORD,  USER,  VENDORS,  money,  nextId,  orderStatus,
work-orders.module.css
/* Copyright (c) 2026 Bruno Delorence. MIT License. *//* Work orders (work-orders.tsx): a property-operations board on a warm light grey. A sidebar   (172 px), the list (284 px) and the detail, which takes the rest.   Sizes are the reference's, read off a 1920-wide recording and brought to a board about 1000 px   wide: the title is 24 px (36 there), rows 13 px on a 30 px pitch, buttons 30 px tall. Under   940 px of board the sidebar goes; under 640 px the list and the detail share one column and   the board drills in and out (a container query, so the board answers to its own width).   Motion. Rows that change group glide there over 420 ms (FLIP, from the script); a new row is   tinted blue for 1.6 s; the grey half of the title blurs in over 420 ms; new panels and the   actual cost rise 6 px as they fade in over 320 ms; the dialog grows from 97% over 220 ms; toasts   rise in over 240 ms and fade out after 2.9 s. All on cubic-bezier(0.2, 0.7, 0.2, 1). With reduced   motion every one of them is dropped and the state just changes.   Colours are the tokens below, light-dark(light, dark) where the two differ. */.root {  container: wo / inline-size;  --bg: light-dark(#f3f3f1, #141414);  --line: light-dark(rgb(0 0 0 / 0.07), rgb(255 255 255 / 0.08));  --line-strong: light-dark(rgb(0 0 0 / 0.13), rgb(255 255 255 / 0.14));  --surface: light-dark(#fbfbfa, #1f1f1f);
request-dialog.tsx
// Copyright (c) 2026 Bruno Delorence. MIT License.'use client';import {  useEffect,  useId,  useRef,  useState,  type FormEvent,  type KeyboardEvent as ReactKeyboardEvent,} from 'react';import { CATEGORIES, PRIORITIES, PROPERTIES, type Category, type Priority } from './data';import styles from './work-orders.module.css';/* * The New maintenance request dialog (and Edit request, the same form filled in). A modal inside * the board, not over the whole page: the board behind it is inert while it is open, Tab and * Shift+Tab go round its own controls, Escape or a press on the scrim closes it, and the parent * puts the focus back where it was. * * The form's values live in the parent, so the demo can type into it the way a reader would. */
data.ts
// Copyright (c) 2026 Bruno Delorence. MIT License./* * The data behind the work orders board: maintenance requests, the work order each one gets once * it is assigned, and the words the board says about them. Plain data and pure functions, no * React, so the docs and the demo build on the same seed. * * One record carries the whole lifecycle. A request is `new` until it is assigned; assigning it * opens its work order with a vendor and an estimate, and from then on the request and its order * share one stage: assigned, scheduled, (in progress or waiting on parts), completed. */export type Priority = 'urgent' | 'high' | 'normal';export type Stage = 'new' | 'assigned' | 'scheduled' | 'progress' | 'waiting' | 'completed';export type Category = 'Plumbing' | 'Electrical' | 'Appliance' | 'Heating and cooling' | 'General';export type WorkOrder = {  /** WO-2564 */  id: string;  vendor: string;  estimate: number;  approved: number;  /** Set when the work is completed. */  actual?: number;
glyphs.tsx
// Copyright (c) 2026 Bruno Delorence. MIT License./* * The board's icons, drawn by hand on a 16-unit grid with 1.5-unit round strokes in currentColor, * so each one takes the colour of the text it sits in. All are decorative: the words beside them * carry the meaning. */export type GlyphName =  | 'mark'  | 'search'  | 'home'  | 'layers'  | 'key'  | 'people'  | 'coin'  | 'wrench'  | 'hammer'  | 'building'  | 'chart'  | 'bell'  | 'moon'  | 'sun'  | 'plus'
demo-pointer.tsx
// Copyright (c) 2026 Bruno Delorence. MIT License.'use client';import type { CSSProperties, Ref } from 'react';/* * The demo's pointer, and the steps that move it. A demo is a script of awaited steps: wait, or * glide the pointer somewhere. Stopping the demo (the reader takes over, or it scrolls away) ends * the step in progress at once: its promise rejects, which ends the script right there, and the * pointer fades out. * * Each glide is a curved flight played by the Web Animations API, so nothing runs frame by frame. * The points of the flight are handed to whoever wants to move along with it (nothing here uses * them here). The arrow and the hand are HTML boxes * that swap by their visibility: a change of style inside an SVG would lay the SVG out again. */export type Point = { x: number; y: number };/** A glide's path and timing, for an animation that plays along with it. */export type Flight = { points: Point[]; timing: KeyframeAnimationOptions };export type Demo = {
use-autoplay.ts
// Copyright (c) 2026 Bruno Delorence. MIT License.'use client';import { useCallback, useEffect, useRef, useState } from 'react';/* * When a demo may play on its own: while part of it is on screen and the tab is visible, never * under reduced motion, and never again once the reader has used it: `take()` hands it to the * reader for good (until the component mounts again), so it can't come back on its own. */export function useAutoplay<T extends HTMLElement>() {  const ref = useRef<T>(null);  const [visible, setVisible] = useState(false);  const [reduced, setReduced] = useState(true);  const [taken, setTaken] = useState(false);  useEffect(() => {    const element = ref.current;    if (!element) return;    let onScreen = false;    const update = () => setVisible(onScreen && !document.hidden);    const observer = new IntersectionObserver(      ([entry]) => {