Prose UI with TanStack Start
This guide walks you through setting up a fresh TanStack Start project with Prose UI.
Start by creating a new project:
Set up MDX rendering with Content Collections
Content Collections helps you keep your MDX content organized and handles rendering your MDX files. The setup below is based on the Content Collections Next.js quickstart and the MDX guide.
Install the required packages:
Add the content-collections path to your tsconfig.json:
Add the Content Collections Vite plugin to your Vite config. It must be the first plugin in the list:
Add .content-collections to your .gitignore:
Create content-collections.ts file at the root of your project:
Set up Prose UI and Markdown rendering
Install the Prose UI dependencies:
Import the styles into your styles.css:
In your content-collections.ts, initialize and pass remarkPlugins to the MDX compiler:
Create the route that will render your Markdown
Create the route at src/routes/posts/$.tsx. Pass Prose UI mdxComponents into MDXContent, and wrap the content in an element with the prose-ui CSS class:
Add your first page
Create a folder content/posts and add your first page:
Run your project, then open http://localhost:3000/posts/hello to view your rendered MDX page.