Installation overview
Prose UI works with any React + MDX setup. This page gives you a high‑level overview and generic installation steps.
If you're using Next.js or TanStack Start, follow the framework guides for Next.js or TanStack Start to get tailored instructions.
General overview
Prose UI has three main pieces:
React components
These components power callouts, code blocks, steps, and other rich elements in your MDX content.
Available as
mdxComponentsfrom@prose-ui/reactfor any React runtime, and@prose-ui/nextfor Next.js.CSS styles
Provides typography and styling for both prose and components.
Available as
prose-ui.cssfrom@prose-ui/style. Wrap your content with theprose-uiCSS class.Remark plugins
Enables code highlighting, math formulas, and other transformations during the Markdown/MDX build step.
remarkPlugins()is available from@prose-ui/core. Add these plugins to your Markdown/MDX pipeline.
The rest of this page walks through each of these pieces in a generic React + MDX setup.
React components
To get highlighted code blocks, callouts, math, and other components, you need to provide Prose UI components to your MDX renderer.
For any React app:
For Next.js apps:
Then pass mdxComponents to your MDX renderer. For example, with Content Collections:
CSS styles
Prose UI ships default typography and component styles in a single stylesheet, scoped under the prose-ui class.
Import prose-ui.css into your global stylesheet and wrap your content in a container with the prose-ui class:
prose-ui.css– base typography and component styleskatex.min.css– only needed if you use math formulas
Prose UI uses the dark class on the <html> element to switch to dark mode, so it plugs into most existing theme toggles.
The easiest way to customize Prose UI is by overriding the CSS variables defined in @prose-ui/style/prose-ui.css.
Remark plugins
The remarkPlugins(options) function from @prose-ui/core powers most of the "magic":
- Syntax‑highlighted code blocks
- LaTeX math formulas
- Mapping basic Markdown to React components (e.g. images to
<Image>)
You should initialize the plugins once and pass them into your Markdown/MDX pipeline.
For example, with Content Collections:
In other setups (e.g. your own MDX bundler, Vite plugin, or a custom build step), you wire plugins into the place where you normally configure remarkPlugins. The exact API will differ, but the idea stays the same: create the plugins with remarkPlugins() and pass them to your MDX processor.