Bruno DelorenceBruno
Appearance
Appearance

Choose your reading theme.

Contact

Contracts table

A dark contracts table with a notice-date timeline per row, approval circles, risk bars and a floating action bar for the selection.

contracts-table/contracts-table.tsx
Live · interactive

Contracts

128 active · Playbook SaaS vendor v3

ContractTimeline, October to MarchApprovals
Kestrel CloudOrder form · $84kOct 31, soon24
Halden WorksMSA · $240kNov 1, soon78
Mosaic DataDPA · $36kDec 141
Quill & CoServices · $18kDec 3055
Arbor LabsReseller · $120kDec 3133
Fernway HealthSaaS · $56kJan 112
Tidewell StudioLicence · $9kJan 2029
Brightline FreightLogistics · $64kFeb 218
Copperleaf MediaLicence · $27kFeb 1562

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

  • A legal or procurement queue where the date that matters is a deadline to act (the last day to give notice) before something happens on its own (the renewal).
  • Rows that each carry a short sign-off chain (Legal, Finance, Security, Owner) and need to show where it stops at a glance, with the detail one hover away.
  • Bulk work on a filtered list: tick a few contracts, then remind their owners, push their notice dates or open their reviews together from one bar.
  • A few dozen to a few hundred items that people re-sort between two questions, what is due first and what is riskiest, and need to see the order change.

When not to use

  • One contract’s detail. Use a review page with its clauses, redlines and the full approval history.
  • Dates spread over years or many events per row. Use a Gantt or project timeline; the track here covers six months and three marks.
  • Thousands of rows with free filtering and column picking. Use a data grid with virtual scrolling and server-side sort.
  • A plain list with no deadlines, approvals or risk. Use a simple table or a list; the timeline and circles would be noise.
  • Phones as the main screen. Under 500 px the table scrolls sideways; give mobile a card list grouped by notice date instead.

Reading the timeline

  • The track is six months, October 1 to April 1, 124 px wide, so a date is a position and rows can be compared down the column.
  • The grey bar runs to the last day to give notice; the hatched window runs from there to the renewal, and the tick marks the renewal itself.
  • The dashed line is today, at the same place in every row.
  • Amber marks a notice date 21 days off or closer, on the bar and on the date beside it, which is also set in bold.
  • The six months and today are set in data.ts; dates past the end pin to the right edge and lose their tick.

Approvals and risk

  • Four circles, always in the same order: Legal, Finance, Security, Owner.
  • Each state has its own mark: a check when approved, turning spokes while in review, a cross for changes requested and an empty dashed ring while waiting.
  • Risk is a score from 0 to 100 with five bars, one per 20 points: grey under 50, amber to 69, red from 70.

Selection and bulk actions

Ticking any row slides the action bar up with the count: Remind owner, Extend notice (30 days later) and Open review, the one filled button. Remind owner and Open review hand the selected contracts to onRemind and onOpenReview; the selection survives a tab change, so the count can include rows out of sight. Escape in the table clears it.

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

Each row is read left to right in a second: who, what kind and how much, then when, who has signed and how risky.

  • The contract’s name is the other party as the team calls it: Halden Works, not the legal entity with its suffix.
  • The kind of paper in a word or an abbreviation people know: MSA, DPA, Order form, Licence.
  • The value is yearly, in thousands of dollars, a whole number: 240 is drawn $240k.
  • The owner is a first name; it is what Reminder sent reads out: Reminder sent to Ana, Rui.
  • The playbook names the review template and its version, Playbook SaaS vendor v3, short enough for one line beside the count.

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

Into components/contracts-table of any React project, with no setup:

Terminal
npx shadcn@latest add https://brunodelorence.com/r/contracts-table.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

renewals.tsx
import { ContractsTable } from './contracts-table';export function Renewals() {  return (    <ContractsTable      defaultTab="renewing"      defaultSelected={[]}      autoplay={false}      onOpenReview={(contracts) => console.log(contracts.map((c) => c.id))}    />  );}

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.

The contracts a team keeps, as one card. Tabs filter by status, and each row shows its next six months on a small timeline: a bar up to the last day to give notice, a hatched window to the renewal, a tick on that day, and a dashed line for today. Notice dates three weeks off turn amber. Select rows and an action bar slides up to remind owners, extend notice or open a review; sort by notice date or risk and the rows glide into place.

  • A real table with fixed column widths. The timeline is 124 px for the six months from October 1, so a date is a position: the grey bar runs to the notice date, the hatched window from there to the renewal (a 45° repeating gradient) and a 2 px tick marks the renewal. Today’s dashed line is one repeating gradient per row, at the same x.
  • Extend notice moves the selected contracts 30 days later. The window and the tick slide by a transform and the grey bar grows to meet them, over 600 ms; a notice date that is no longer close loses its amber.
  • Sorting is FLIP: before the change each row’s place is noted, after it each row is moved back where it was by a transform and played to zero by the Web Animations API in 420 ms. A new tab fades its rows in instead, 28 ms apart.
  • The tabs’ pill is one element that slides to the active tab and takes its width; arrow keys move between tabs.
  • The action bar is always there, translated below the frame and transparent; any selection slides it up in 380 ms, with the count rising into place when it changes. The bottom of the list fades to the frame’s colour under it, and the list scrolls under a sticky header.
  • Approvals are four 18 px circles: approved (green check), in review (eight spokes turning in steps), changes requested (red cross) and waiting (dashed ring). Hovering one shows its step and state; focusing the cell lists all four.
  • While on screen and untouched, a demo pointer extends a notice, selects a row, reads an approval, sorts by risk, selects all and visits another tab, then starts again. Any key, press or wheel hands it to the reader.
  • Every colour is a light-dark() token on the root, so the card follows the page’s color-scheme or the colorScheme prop. Under 500 px the table scrolls sideways inside its frame, the subtitle wraps and the action bar spans the frame.
PropTypeDefaultDescription
contractsContract[]CONTRACTSThe rows: name, type, value in $k, status, notice and renewal days from October 1, four approvals, risk 0–100 and owner. The tab counts come from them.
playbookstring'Playbook SaaS vendor v3'The playbook the reviews follow, under the title.
defaultTab'all' | 'renewing' | 'review' | 'signed''renewing'The tab open at first.
defaultSelectedstring[]['halden']Ids of the contracts selected at first.
onNewReview() => void—Called by the New review button.
onOpenReview(contracts: Contract[]) => void—Called by Open review, with the selected contracts.
onRemind(contracts: Contract[]) => void—Called by Remind owner, with the selected contracts.
autoplaybooleantrueWhile on screen and untouched, a demo pointer goes through the table: extend, select, sort, select all, change tabs.
colorScheme'light' | 'dark' | 'system'—Light or dark colours, or the reader’s; without it, the page’s color-scheme.
defaultState{ sort?: 'notice' | 'risk'; extended?: string[]; tip?: string; hover?: string; reminded?: boolean }—Opens on a moment: a sort, contracts already extended by 30 days, a row’s approvals tooltip open, a hovered row, or Reminder sent. Giving it keeps the demo off.
classNamestring—Extra class for the root.

Table and sorting

A real table with column headers and each contract’s name as its row header, so a screen reader announces the contract with every cell (WCAG 1.3.1, Info and relationships). The sorted column carries aria-sort, and Notice, Risk and the Sorted by label are buttons. The tabs are a tablist: arrow keys move between them, and only the active one is in the tab order.

Selection and bulk actions

  • Every row has a real checkbox named after its contract, Select Halden Works; the header one is mixed when some rows are ticked.
  • Escape in the table closes an open tooltip first, then clears the selection.
  • The action bar is a toolbar, inert while nothing is selected, so its buttons are never reached hidden.
  • Sorting, tab changes, extensions and reminders are read out in a polite live region (WCAG 4.1.3, Status messages).

Dates, states and colour

  • Each timeline is an image named with its dates, Notice by Oct 31, renews Dec 30, and the notice date is also written in its own column.
  • A close notice date is bold as well as amber, so it does not rest on colour alone (WCAG 1.4.1, Use of color), and a screen reader hears “soon” after it. Sorting by notice puts it first.
  • The approval states differ by mark as well as colour (WCAG 1.4.1, Use of color). The approvals cell takes focus, is named with all four, and lists them in a tooltip.
  • The tooltip stays open while the pointer moves onto it, and Escape closes it wherever the focus is (WCAG 1.4.13, Content on hover or focus).

Targets and motion

Each checkbox’s input is 28 × 28 px over its 16 px box, the tabs are 26 px high and the action buttons 32 px, above the 24 × 24 px minimum (WCAG 2.5.8, AA). The demo plays only while the table is on screen, and the first click, key press, scroll or touch stops it for good; autoplay={false} turns it off (WCAG 2.2.2, Pause, Stop, Hide). Under reduced motion nothing glides, fades or spins, and the demo never plays.

In this build

  • A real table: column headers, each contract’s name as its row header, aria-sort on the sorted column. Notice and Risk in the header are buttons that sort; so is the “Sorted by” label.
  • The tabs are a tablist with arrow keys and roving focus, controlling the table as its tabpanel.
  • Each row and the header have real checkboxes (the header one is mixed when some rows are chosen), named after their contract. Escape in the table clears the selection.
  • The action bar is a toolbar, inert while nothing is selected. Sorting, tab changes, reminders and extensions are announced in a polite live region.
  • Each timeline is an image named with its dates (“Notice by Oct 31, renews Dec 30”); the approvals cell is focusable, named with all four states, and shows them in a tooltip on focus.
  • Focus rings show for keyboard use. Under reduced motion nothing glides, fades or spins, and the demo never plays.

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

contracts-table.tsx
// Copyright (c) 2026 Bruno Delorence. MIT License.'use client';import {  useEffect,  useEffectEvent,  useId,  useLayoutEffect,  useMemo,  useRef,  useState,  type CSSProperties,  type KeyboardEvent as ReactKeyboardEvent,} from 'react';import {  CONTRACTS,  SPAN,  STEPS,  TICKS,  TODAY,  dayLabel,  type Approval,  type Contract,
contracts-table.module.css
/* Contracts table (contracts-table.tsx): a card on a quiet stage, near-black at night and white   by day. The card is 582px wide at most; under that it takes the stage's width and the table   scrolls sideways inside its frame, so the page never does.   Colours are the tokens below, light-dark(light, dark) where the two differ: the component takes   the color-scheme it inherits from the page (light unless the page says otherwise), or the one   its colorScheme prop sets (data-color-scheme).   Motion is transforms and opacity: the action bar slides, rows glide when re-sorted (the Web   Animations API) and fade in on a new tab, the notice window slides along its track. The tab   pill also eases its width. Under reduced motion, all of it simply changes. */.root {  /* The stage, the card on it, the table's frame and its header. */  --stage: #f1f1f2;  --card: #fff;  --card-edge: rgb(0 0 0 / 0.08);  --frame: #fbfbfb;  --head: #fff;  --line: #ececee;  --row-hover: #f5f5f7;  --row-selected: #f1f0ff;  /* Words: strong, muted, faint. */  --ink: #141416;
data.ts
// Copyright (c) 2026 Bruno Delorence. MIT License./* * The contracts the table shows: invented companies, plausible terms. Dates are days counted from * the timeline's first day (October 1), so the drawing needs no calendar maths; `dayLabel` turns * them back into "Oct 31". Nine contracts are up for renewal and four are in review, written out * by hand; the 115 signed ones are made from two word lists by a fixed recipe, so every render * draws the same table. *//** Where one sign-off stands. */export type Approval = 'done' | 'active' | 'rejected' | 'waiting';export type Status = 'renewing' | 'review' | 'signed';export type Contract = {  id: string;  name: string;  /** The kind of paper: MSA, DPA, Order form… */  type: string;  /** Yearly value, in thousands of dollars. */  value: number;  status: Status;  /** The last day to give notice, in days from October 1. */
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. 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 = {  /** Resolves after `ms`. */
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 remounts), so it does not come back on its own (WCAG 2.2.2). */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]) => {