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

import {
  MARKUP_PROMPTS,
  MARKUP_REACT_SNIPPET,
  MARKUP_SCRIPT_SNIPPET,
} from "../../../../packages/studio/src/shared/markup-prompt.ts";

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.

<PromptCard
  label="Where Markup goes"
  modes={[
    { label: "React app", text: MARKUP_PROMPTS.react },
    { label: "Any page", text: MARKUP_PROMPTS.script },
  ]}
/>

## Add Markup to a React app

Install the package as a dev dependency:

<Commands code={`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:

```ts
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`:

<CodeBlock lang="tsx" code={MARKUP_REACT_SNIPPET} />

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:

<CodeBlock lang="html" code={MARKUP_SCRIPT_SNIPPET} />

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

```html
<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`:

```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:

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

For a stylesheet, use a `text/css` tag:

```html
<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.
