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 a specific framework like Next.js or TanStack Start, you’ll get a smoother experience by following the corresponding framework guide instead.
General overview
Prose UI has three main pieces:
-
React components
Available as@prose-ui/reactfor any React runtime, and@prose-ui/nextfor Next.js.
You only need one of these packages, and you pass its components into your MDX renderer. -
CSS styles
Available from@prose-ui/style.
You import a single CSS file into your global styles and wrap your content in aprose-uicontainer. -
Remark plugins
Available from@prose-ui/core.
You add these plugins to your Markdown/MDX pipeline to enable code highlighting, math, images, and other components.
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
mdxComponentsto your MDX renderer. For example, with Content Collections:You can also import individual componentsCSS styles
Prose UI ships default typography and component styles in a single stylesheet, scoped under the
prose-uiclass.Import the styles into your global stylesheet:
globals.cssprose-ui.css– base typography and component styleskatex.min.css– only needed if you use math formulas
Then wrap your rendered Markdown/MDX content in a
prose-uicontainer:Prose UI uses the
darkclass on the<html>element to switch to dark mode, so it plugs into most existing theme toggles.Customizing stylesThe easiest way to customize Prose UI is by overriding the CSS variables defined in
@prose-ui/style/prose-ui.css. You can inspect the generated CSS and override the variables in your own stylesheet.Remark plugins
The
remarkPlugins(options)function from@prose-ui/corepowers 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
pluginsinto the place where you normally configureremarkPlugins. The exact API will differ, but the idea stays the same: create the plugins withremarkPlugins()and pass them to your MDX processor.