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

Configuration

Every setting in dex.config.ts, its default, and what it changes.

Every Dex setting is in dex.config.ts at your project’s root. Every setting has a default, and most projects set only content and designSystem. Dex checks the file when it loads and reports a mistake with its path. The file can be .ts, .mts, .js or .mjs.

import { defineConfig } from "@dexhq/canvas/config";

export default defineConfig({
	content: "./studio",
	ui: { title: "Acme Studio", components: "./studio/ui.tsx" },
});

Settings

Setting Default What it does
content "." The folder with files/, DESIGN.md, people/ and contributors.
designSystem Read from components.json The components, styles and guide views build with. See Design systems.
designSystem.provider None A module whose default export wraps every view. See below.
build.comments true Whether dex build includes every file’s comments, read-only. Set false for a public deploy.
build.pictures true Whether builds include a picture of every view, so zoomed-out frames show. Needs Playwright’s Chromium.
build.review true Whether people on a built site can mark up its canvases and send their comments back as a file.
git.share "sync" How the team shares work: Sync or pull requests. See Share work with git.
git.syncBranch "dex/sync" The branch Sync shares on.
git.base The remote’s default branch The branch Sync keeps up with and pull requests merge into.
git.prefix "dex/" The start of every new branch’s name.
outDir node_modules/.cache/dex/dist Where dex build writes the static site.
port 3008 The port for dex dev and dex preview. STUDIO_PORT overrides it.
plugins None Extra Vite plugins, such as next() or StyleX.
vite None A function that makes a last change to the Vite config.
ui.title "Dex" The workspace’s name, in the sidebar and the browser tab.
ui.workspaceIcon None The workspace’s icon: "workspace-icon.svg" or "workspace-icon.png", in the content folder, up to 256 KB.
ui.theme "studio" The interface’s look. "design-system" gives it your design system’s colours. Views always use your design system.
ui.locale The browser’s language The interface’s language. "pseudo" pads every string, to check translations.
ui.accent Tailwind’s blue-600 The colour of selection, pins and the active tool. Any CSS colour.
ui.components None A module whose exports replace parts of the interface. See below.
ui.primitives Dex’s own Your shadcn components for the interface’s buttons, menus and dialogs. See below.
ui.chromeTheme None With ui.theme: "design-system", maps the interface’s colours to your tokens when their names differ from shadcn’s.

You can change ui.title, ui.workspaceIcon and git in Settings → General, and build in Settings → Deployment.

Next.js built-ins in views

Components written for a Next.js app can use process.env, next/link, next/image, next/font and the router’s hooks. Views get them from the next() plugin, which create adds in a Next.js app:

import { defineConfig } from "@dexhq/canvas/config";
import { next } from "@dexhq/canvas/next";

export default defineConfig({
	content: "./studio",
	plugins: [next()],
});

process.env has NODE_ENV and the NEXT_PUBLIC_ variables from your .env files. next/image renders a plain <img>, fonts from next/font don’t load, and the router doesn’t navigate.

A provider around every view

Some design systems render only inside a provider, such as Mantine’s MantineProvider or MUI’s ThemeProvider. Point designSystem.provider at a module whose default export wraps its children:

import "@mantine/core/styles.css";
import { MantineProvider } from "@mantine/core";
import type { ReactNode } from "react";
import { theme } from "../src/theme";

export default function Provider({ children }: { children: ReactNode }) {
	return <MantineProvider theme={theme}>{children}</MantineProvider>;
}

Every view renders inside it: on the canvas, in Play and in a built studio. dex doctor checks that the module exists and has a default export.

Replace parts of the interface

Export React components from the ui.components module to replace parts of the interface:

export const Logo = () => <img alt="" src="/logo.svg" width={20} />;
export const HomeIntro = () => <p>Start from the Checkout file.</p>;
Export Replaces
Logo The workspace’s icon in the sidebar.
HomeIntro The panel at the top of the Recents page.

Use your components in the interface

Dex’s buttons, menus and dialogs are shadcn components on Base UI. If your project has the same components, set ui.primitives and Dex uses yours instead of its own copies:

ui: { primitives: "@/components/ui" }

Set it to true to use the components in designSystem.components. Dex’s own components fill any gap. It’s off unless you set it, or run create --primitives, so the interface keeps Dex’s own corners, sizes and Lucide icons whatever your components look like.