Bruno DelorenceBruno
Appearance
Appearance

Choose your reading theme.

Contact

Motion specimens

New

A drifting wall of wireframe app windows, each looping one interaction you can also play yourself.

motion-specimens/motion-specimens.tsx
Live · interactive
Command palette
Toast
Drawer
Page transition
Like burst
Card expand
Sort menu
Tabs

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

  • Showing a set of interactions at a glance: a component library’s landing page, a motion guide, a design system’s overview.
  • Comparing motion side by side: how a palette, a drawer and a dialog open in the same product, at the same speed.
  • A hero or a section break where the product’s feel matters more than its words, each tile playable by the reader.
  • Teaching what a pattern is called: the wireframe strips the page down to the motion, and the name sits under it.

When not to use

  • Demonstrating one interaction in depth. Show the real component, at full size, with its states.
  • Documentation that must be read without motion, or printed: give a still per state with a caption.
  • Inside an app’s working screens. Specimens are pictures of an interface, not the interface: they hold no data.
  • A page already busy with animation. Eight loops at once compete with anything else that moves; show four, or turn the drift off.

Playing a specimen

  • On its own, each tile’s pointer plays its interaction in a loop of about six seconds, the tiles starting one after another so the wall doesn’t move in step.
  • The reader’s pointer or focus on a tile rests its demo; it comes back 0.9 s after they leave. A click or a key in the tile hands it over for good.
  • Real clicks run the same code the demo does: the palette, the toasts, the like, the dialog, the drawer, the links, the menu and the tabs all work.

Staying light

  • Moves are CSS transitions and one-shot Web Animations: nothing runs frame by frame in script.
  • A tile out of view stops, by an IntersectionObserver that counts the stage’s clip, so tiles drifted off the stage rest too; the drift stops off screen and in a hidden tab.
  • Nothing loops forever in CSS: a toast’s bar drains once, the caret doesn’t blink.

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

The only words on screen are the specimens’ names; everything in the windows is drawn.

  • A pattern’s common name, in sentence case: Command palette, Like burst, Page transition.
  • No made-up words in the windows: bars stand for text, so the motion is what reads.
  • Screen readers get real names: each control in a window is named (“Search”, “Save changes”, “Like, 24”, “Sort by Newest”).

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

Into components/motion-specimens of any React project, with no setup:

Terminal
npx shadcn@latest add https://brunodelorence.com/r/motion-specimens.json

Either way it needs React 19 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

motion-section.tsx
'use client';import { MotionSpecimens } from './motion-specimens';export function MotionSection() {  return (    <MotionSpecimens      onInteract={(specimen, action) => console.log(specimen, action)}    />  );}

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 light grid of small greyscale app windows, each named in a pill under it and each playing its own interaction with a pointer of its own: a command palette opens over a dimmed dashboard and a result is picked, toasts stack in and drain away, a heart bursts and its count rolls from 24 to 25, a stat card grows into a dialog with a bar chart, a drawer slides in, a page gives way to the next, a menu reorders a list, tabs morph a chart. The wall drifts slowly across the stage. Rest the pointer on a tile and its demo stops: every click in it works.

  • Every window is a wireframe drawn at 322 × 218 px (a 20 px title bar over the page), the size measured in the reference, and scaled as a whole to its tile with --s, read from one frame’s width by a ResizeObserver. The window takes 67% of its tile, its name pill 14 px under it.
  • Eight specimens make a wall four by two, each tile 42% of a 16 : 9 stage wide. The drift is one Web Animation on the wall, corner to corner and back at 14 px a second; it stops while the mouse is over the wall, off screen and in a hidden tab, and keyboard focus in a tile out of view slides the wall 420 ms to show it.
  • Each tile’s demo is a pointer that glides on curved paths and dips 220 ms on a press, calling the same functions as the reader’s clicks. It plays only while half the tile is in view (an IntersectionObserver, which counts the stage’s clip), starts 450 ms after its neighbour, rests while the pointer or focus is on the tile and comes back 0.9 s after; a click or a key there hands the tile over for good.
  • Openings run 200–340 ms on cubic-bezier(0.2, 0.8, 0.2, 1) and closings faster on an ease-in: the palette drops 5 px from 97%, the drawer slides in 340 ms and out 220 ms, toasts enter from 14 px below at 94% (@starting-style) and leave 16 px to the left, draining their bar over 3.2 s.
  • The card expands by a FLIP: the 218 × 154 dialog is laid out in place, then played from the card’s rect in 380 ms and back in 260 ms; its eight bars rise 35 ms apart. The like dips to 72%, pops to 128% and throws six dots 11 px out, one-shot Web Animations, while the count rolls.
  • Slides that land use a spring written as linear() (a 7% overshoot, settled in 0.45 s): the sidebar’s current item, the page underline, the sorted rows, the tab pill and the chart’s twelve bars, 22 ms apart.
  • Under 640 px of stage the wall becomes a grid of two columns, and one under 480, with no drift. Every colour is a light-dark() token: at night the wireframes invert. Reduced motion stops the drift and the demos, and every interaction lands on its end state at once.
PropTypeDefaultDescription
specimens('palette' | 'toast' | 'like' | 'expand' | 'drawer' | 'pages' | 'sort' | 'tabs')[]all eightWhich specimens, in order. More than four make a drifting wall four wide; four sit two by two, fewer in one row.
pose'rest' | 'open''rest'open starts every tile with its interaction at its end, as a still for docs and screenshots, and turns the demos off.
driftbooleantrueWhether a wall wider than the stage drifts slowly across it.
autoplaybooleantrueWhile a tile is on screen and untouched, its pointer plays its interaction in a loop; input in the tile stops it.
onInteract(specimen: SpecimenId, action: string) => void—Called when the reader (never the demo) does something in a tile: "open palette", "save", "like", "sort by Name"…
colorScheme'light' | 'dark' | 'system'—Light or dark colours, or the reader’s; without it, the page’s color-scheme.
classNamestring—A class for the stage.

Keyboard

  • Tab reaches each window’s controls in turn. Focus in a tile out of view slides the wall to bring it in, and stops the drift.
  • Opened surfaces take the focus (the palette’s first result, the dialog’s and the drawer’s close button, the menu’s current item) and give it back on Escape.
  • The palette and the menu move with the arrows; the tabs move with Left and Right.

Screen readers

  • Each window is a group named after its specimen; the title bars, the bars and the demo pointer are hidden.
  • The palette, the dialog and the drawer are dialogs with names; the sort menu is a menu of radio items; the tabs are a tablist.
  • New toasts are read from a polite live region: “Changes saved”.

Motion

With reduced motion there is no drift and no demo, and every interaction lands on its end state at once: no transitions, pops, bursts or FLIPs.

In this build

  • Each window is a group named after its specimen; its controls are real buttons with names (“Search”, “Save changes”, “Like, 24”, “Sort by Newest”). The title bars, the wireframe bars and the demo pointer are hidden from screen readers.
  • The palette, the card’s dialog and the drawer take the focus when the reader opens them and give it back to their opener on Escape or close; closed, they are inert.
  • The palette moves with Up and Down, the sort menu (a menu of radio items) with Up, Down, Home and End, the tabs (a tablist with one tab stop) with Left and Right.
  • Focus in a tile out of view slides the wall to show it and stops the drift; every control shows a 2 px focus ring, thickened by the window’s scale.
  • New toasts are read from a polite live region (“Changes saved”).
  • With reduced motion there is no drift and no demo, and every interaction lands on its end state at once.

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

motion-specimens.tsx
// Copyright (c) 2026 Bruno Delorence. MIT License.'use client';import {  useEffect,  useLayoutEffect,  useRef,  useState,  type ComponentType,  type CSSProperties,} from 'react';import { DemoPointer, runDemo } from './demo-pointer';import { Like, Pages, Sort, Tabs } from './in-place';import { WIN, makeKit, type BodyProps, type Pose, type SpecimenHandle } from './kit';import { Drawer, Expand, Palette, Toasts } from './overlays';import { useAutoplay } from './use-autoplay';import styles from './motion-specimens.module.css';/* * Motion specimens: a wall of small greyscale app windows, each with its name under it and one * interaction looping inside it (a command palette, toasts, a like that bursts, a card that * expands into a dialog, a drawer, a page transition, a sort menu, tabs), while the wall drifts * slowly across the stage.
motion-specimens.module.css
/* Motion specimens (motion-specimens.tsx): a wall of greyscale wireframe windows on a light grid,   each with its name in a pill under it and one interaction looping inside it.   Sizes. Every window is drawn at 322 × 218 px (a 20 px title bar over the page) and scaled as a   whole by --s, which the script reads from one frame's width: so the px below are the window's   own, as measured in the reference. A cell is 480 × 360 window px in the reference: the window   takes 67% of its width, its name 14 px under it. Cells are containers, so the frame and the   name follow the cell (cqi).   Layout. Eight specimens make a wall of four columns, each 42% of the stage wide, wider than the   stage, which the script drifts. Up to four sit in a still grid. Under 640 px of stage both are a   grid of two columns, and one under 480.   Colours are the tokens below, light-dark(light, dark): at night the wireframes invert, light   bars on dark windows, and the ink (dark buttons, the heart, the pointer) turns light.   Motion. Openings are 200–340 ms on an ease-out (cubic-bezier(0.2, 0.8, 0.2, 1)), closings   faster on an ease-in; slides that land (the sidebar's mark, the underline, the rows, the pill,   the bars) use a spring written as linear(). Reduced motion drops every transition and   animation, so each interaction lands on its end state at once. */.root {  --stage: #f7f7f9;  --grid: #e9e9ec;
overlays.tsx
// Copyright (c) 2026 Bruno Delorence. MIT License.'use client';import {  useEffect,  useImperativeHandle,  useLayoutEffect,  useRef,  useState,  type CSSProperties,  type Ref,} from 'react';import { AreaChart, Close, Saved } from './glyphs';import { WIN, Sk, focus, reducedMotion, useKeys, type BodyProps } from './kit';import styles from './motion-specimens.module.css';/* * The specimens that open something over the page: the command palette, the card that expands * into a dialog, the toasts and the drawer. Each draws its page as a wireframe (Sk bars in px of * the 322 × 198 body), keeps its own state, and hands its tile a demo that plays the same * functions the reader's clicks do. * * Opening and closing are CSS transitions on data attributes (the dim, the palette, the drawer,
in-place.tsx
// Copyright (c) 2026 Bruno Delorence. MIT License.'use client';import {  useEffect,  useImperativeHandle,  useRef,  useState,  type CSSProperties,  type KeyboardEvent,} from 'react';import { Check, Chevron, Heart, Picture } from './glyphs';import { Sk, focus, reducedMotion, type BodyProps } from './kit';import styles from './motion-specimens.module.css';/* * The specimens that change the page in place: the like that bursts, the page transition, the * sort menu that reorders a list and the tabs that morph a chart. Moves are CSS transitions on * custom properties (a row's rank, the underline's link, a bar's height), so the browser runs them * off the main thread; the like's pop and its burst of six dots are one-shot Web Animations. *//** Each list row's widths: its name, its line under it, and the meta at its right. */
kit.tsx
// Copyright (c) 2026 Bruno Delorence. MIT License.'use client';import {  useEffect,  useLayoutEffect,  useRef,  type CSSProperties,  type Ref,  type RefObject,} from 'react';import type { Demo, Point } from './demo-pointer';import styles from './motion-specimens.module.css';/* * What the specimens share: the window's size, the pieces of wireframe they are drawn from, and * the kit a tile's demo plays with. * * Every window is drawn at 322 × 218 px (a 20 px title bar over a 322 × 198 body), the size * measured in the reference, and scaled as a whole to its cell: so every length below is a plain * px number, and the demo pointer, a child of the window, scales with it. */
glyphs.tsx
// Copyright (c) 2026 Bruno Delorence. MIT License./* * The few drawn glyphs of the wireframes, each on its own small viewBox and coloured by * currentColor, so a tone class (or the dark scheme) recolours them. */type GlyphProps = { className?: string };const svg = { 'aria-hidden': true, focusable: false } as const;/** A heart: outlined, or filled once liked. */export function Heart({ className, filled }: GlyphProps & { filled: boolean }) {  return (    <svg {...svg} className={className} viewBox="0 0 16 16">      <path        d="M8 13.6 2.7 8.5a3.2 3.2 0 0 1 4.5-4.6l.8.8.8-.8a3.2 3.2 0 0 1 4.5 4.6z"        fill={filled ? 'currentColor' : 'none'}        stroke="currentColor"        strokeWidth="1.5"        strokeLinejoin="round"      />    </svg>  );
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 yet). 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 something may move on its own: while part of it is on screen and the tab is visible, never * under reduced motion, not while the reader holds it (the pointer rests on it, or the focus is in * it), and never again once the reader has used it: `take()` hands it to the reader for good * (until the component mounts again). Each tile of the wall has one, and so has the wall's drift, * so a tile scrolled or drifted out of view stops its demo. */export function useAutoplay<T extends HTMLElement>(threshold = 0.3) {  const ref = useRef<T>(null);  const [visible, setVisible] = useState(false);  const [reduced, setReduced] = useState(true);  const [taken, setTaken] = useState(false);  const [held, setHeld] = useState(false);  useEffect(() => {    const element = ref.current;    if (!element) return;    let onScreen = false;