Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

Markup

Have reviewers mark up any app against an outline you write, then bring their reviews onto the canvas.

Markup is a review tool you add to any app. Reviewers follow an outline of tasks you write, click anything in the app to comment on it, and export their review. You import the reviews into Dex, where each commented page becomes a frame with the comments pinned in place.

Markup runs in the reviewer’s browser, with no server and no account. You can add it to a React app as a component, or to any page with one script tag.

Set up with your agent

To have your coding agent add Markup, copy the prompt for your app into it. It installs Markup, writes a first outline, and tells you how to open it. Settings → Markup in Dex has the same prompts.

Add Dex Markup (npm: @dexhq/markup) to this React app, so reviewers can mark it up against an outline we write and send their reviews back as JSON for us to triage.

  1. Install it as a dev dependency: `npm install @dexhq/markup -D`, or with the app's own package manager.
  2. Write `markup.config.ts` with `defineConfig` from `@dexhq/markup`: a `title`, and an `outline` of a few tasks for what we want reviewed, in Markdown (each task a `## ` heading, its steps a numbered list).
  3. Render `<Markup config={config} />` once, after the app, only in development: `process.env.NODE_ENV === "development"`, or `import.meta.env.DEV` in Vite. With Next.js's App Router, render it from a `"use client"` component with `onNavigate={(path) => router.push(path)}`.
  4. Tell me what you added and how to open Markup in the running app.

If what the review is for isn't clear from the app, ask me before writing the outline. The README has every field, theming included: https://www.npmjs.com/package/@dexhq/markup

Add Markup to a React app

Install the package as a dev dependency:

npm install -D @dexhq/markup

Write the outline in markup.config.ts. Each ## heading is a task, and a numbered list under it holds the task’s steps:

import { defineConfig } from "@dexhq/markup";

export default defineConfig({
	title: "Checkout review",
	outline: `Go through the checkout as a first-time customer would.

## Pay with a declined card {#pay}
1. Go to [payment](/pay)
2. Pay with \`4000 0000 0000 0002\`
`,
});

Then render <Markup /> once, after your app, in development only. In Vite, check import.meta.env.DEV instead of process.env.NODE_ENV:

import { Markup } from "@dexhq/markup";
import config from "./markup.config";

export function App() {
  return (
    <>
      <YourApp />
      {process.env.NODE_ENV === "development" && <Markup config={config} />}
    </>
  );
}

With the Next.js App Router, render it from a "use client" component and pass onNavigate={(path) => router.push(path)}.

Add Markup to any page

Without React or a bundler, add one script tag at the end of <body>. Keep type="module" and the exact version:

<script
  type="module"
  src="https://cdn.jsdelivr.net/npm/@dexhq/markup@0.4.0/dist/cdn/markup.js"
  data-title="Checkout review"
></script>

Put the outline in the page as Markdown, in a tag of its own:

<script type="text/markdown" data-markup-outline>
	# Checkout review

	## Pay with a declined card {#pay}
	1. Go to [payment](/pay)
	2. Pay with `4000 0000 0000 0002`
</script>

Theme Markup to match your app

Markup draws in its own shadow root, so your app’s CSS doesn’t reach it. To match your app, give it a theme. Every part is optional:

  • font: a font family, such as one your app already loads
  • accent: the colour of buttons, pins and the commenting frame. Pick one dark enough for white text.
  • radius: the corner radius. Markup’s other corners follow it.
  • tokens and dark: Markup’s CSS variables in light and dark mode. They use shadcn’s names, such as --background, --foreground, --muted and --border.

Your logo, shown where reviewers are welcomed, is logo, beside theme: SVG markup or an image’s URL.

In a React app, set theme in markup.config.ts:

export default defineConfig({
	title: "Checkout review",
	logo: "/logo.png",
	theme: {
		font: "Inter, sans-serif",
		accent: "#c2410c",
		radius: "6px",
		tokens: { "--background": "#fffdf8", "--border": "#ece6dc" },
		dark: { "--background": "#1c1b19" },
	},
});

To add a stylesheet of your own, pass its text as theme.css. It’s added last, and sets variables on :host, and on .dark for dark mode.

On a page with the script tag, put the same config in the page as JSON:

<script type="application/json" data-markup-config>
	{ "theme": { "accent": "#c2410c", "radius": "6px" } }
</script>

For a stylesheet, use a text/css tag:

<script type="text/css" data-markup-theme>
	:host { --background: #fffdf8; }
	.dark { --background: #1c1b19; }
</script>

For a logo, add data-logo="/logo.png" to the script tag, or put an SVG in a <template data-markup-logo> tag. Each tag wins over the JSON config.

Review an app

Each reviewer:

  1. Reads the outline and enters their name.
  2. Starts a task, ticks off its steps, and clicks anything in the app to comment on it.
  3. Marks the review complete and chooses Export for Dex. This downloads a zip with the review and a snapshot of each page they commented on.

Reviews stay in the browser until they’re exported, so a reviewer can close the tab and come back.

Bring reviews into Dex

In Dex, open Comments on a canvas and choose Import reviews. You can import several zips at once. Each commented page becomes a frame, with a row for each task in the outline and each comment pinned where it was left. When two reviewers commented on the same page, their comments share one frame.

To triage reviews without Dex, import the JSON files from ⋯ in Markup’s own panel.