Installation

Get started with MDX UI in your project in three steps

Requirements

  • Node.js 18 or later
  • A React project using Next.js or Vite React
  • Tailwind CSS configured

Quick Start

1. Initialize

Run the CLI in your project root:

npx @ravikumarsurya/mdx-ui init

This creates mdx-ui.json with your project configuration and installs the cn() utility.

2. Add Components

Add the components you need:

npx @ravikumarsurya/mdx-ui add callout accordion code-block

Or run without arguments to pick interactively:

npx @ravikumarsurya/mdx-ui add

3. Register Components

Add the installed components to your mdx-components.tsx:

import { Callout } from "@/components/mdx/callout";
import {
  Accordion,
  AccordionItem,
  AccordionTrigger,
  AccordionContent,
} from "@/components/mdx/accordion";
 
export const components = {
  Callout,
  Accordion,
  AccordionItem,
  AccordionTrigger,
  AccordionContent,
};

Framework Guides

CLI Reference

CommandDescription
mdx-ui initSet up mdx-ui in your project
mdx-ui add [components]Add components
mdx-ui update [components]Update to latest
mdx-ui remove [components]Remove components
mdx-ui listList all available components
mdx-ui doctorCheck project health
mdx-ui new [title]Scaffold a new .mdx page
mdx-ui saveSave MDX content to a structured path