Make sure you’ve completed the Installation steps before proceeding with setup.
Choose Your Tailwind Version
Select the setup instructions for your Tailwind CSS version:Tailwind CSS v4
Modern setup with the new CSS-first configuration
Tailwind CSS v3
Traditional setup with JavaScript configuration
Tailwind CSS v4
Tailwind CSS v4 introduces a new CSS-first configuration approach. The order of imports is critical for proper theming.Import component styles first
Open your main CSS file (usually
app/globals.css or src/index.css) and add the component styles before the Tailwind import:globals.css
Configure theme variables
Customize component styling using CSS variables in the These variables will be available to both Tailwind and the components.
@theme block:globals.css
Tailwind v4 Example
Here’s a complete example with dark mode support:globals.css
Tailwind CSS v3
For Tailwind CSS v3, import the styles and configure your theme intailwind.config.js.
Import component styles
Open your main CSS file and import the component styles before the Tailwind directives:
globals.css
Configure tailwind.config.js
Extend your Tailwind configuration to customize component styling:
tailwind.config.js
Add
node_modules/@mintlify/components/**/*.js to the content array so Tailwind includes the component styles.Tailwind v3 Example
Here’s a complete configuration with custom colors and dark mode:tailwind.config.js
Import Order Explained
The import order is critical for proper theming and customization:Start Using Components
Now you’re ready to use Mintlify Components in your application. Here’s a comprehensive example:Component Exports
All components are exported from the main entry point with their TypeScript types:The
cn utility function is also exported for advanced Tailwind class merging using tailwind-merge and clsx under the hood.Next Steps
Explore Components
Browse the full component library and examples
Theming Guide
Learn how to customize colors and styles
TypeScript
Use components with full type safety
Dark Mode
Implement dark mode in your documentation
Troubleshooting
Styles not applying
Styles not applying
If component styles aren’t being applied:
- Verify the import order in your CSS file
- Check that
@mintlify/components/styles.cssis imported before Tailwind - Clear your build cache and restart your dev server
- For Tailwind v3, ensure
node_modules/@mintlify/components/**/*.jsis in thecontentarray
Theme overrides not working
Theme overrides not working
If your custom theme values aren’t overriding component defaults:Tailwind v4:
- Ensure
@import "@mintlify/components/styles.css"comes before@import "tailwindcss" - Place theme customizations in the
@themeblock
- Ensure
@import "@mintlify/components/styles.css"comes before@tailwinddirectives - Use
extendin yourtailwind.config.jsto preserve default values
Build errors with Tailwind v4
Build errors with Tailwind v4
If you encounter build errors with Tailwind CSS v4:
- Update to the latest version:
npm install tailwindcss@latest - Ensure you’re using
@import "tailwindcss"(not@tailwinddirectives) - Check that your build tool supports Tailwind v4 (Vite 6+, Next.js 15+, etc.)