How it works
If you just want to start using Prose UI quickly, feel free to jump to the installation guide or begin with one of the templates.
Prose UI consists for 3 main elements:
- React components
Available in@prose-ui/next
- CSS styles
Available in@prose-ui/next/prose-ui.css
- Remark plugins
Available in@prose-ui/core
React components
The mdxComponents
array from @prose-ui/next
includes React server components necessary for rendering elements such as highlighted code blocks, callouts, images, headings, and frames.
Prose UI also exports these components individually for use outside of MDX.
CSS styles
CSS styles from @prose-ui/next/prose-ui.css
provide default styles for typography and Prose UI components, scoped under the prose-ui
ancestor CSS class.
In Next.js, it's recommended to import these styles into your globals.css
file:
Prose UI uses the presence of the dark
CSS class on the <html>
element to determine whether to render content in dark mode.
The easiest way to customize styles is by overriding the CSS variables defined in @prose-ui/next/prose-ui.css
.
Remark plugins
The remarkPlugins(options)
function from @prose-ui/core
enables essential
features such as converting Markdown images to optimized next/image
components
and Markdown links to next/link
components.
The function accepts an optional options
object, and returns an arary of remark plugins you can use to set up your MDX renderer.
Here's an example: