Skip to main content
Mintlify pages use a standard layout by default, with a sidebar, content area, and table of contents. Customize this layout with page modes to create landing pages, feature showcases, or any page that needs a unique design. This guide covers how to use page modes, Tailwind CSS, and components to build custom layouts.

Choose a page mode

Set the mode field in your page’s frontmatter to control which UI elements appear. For landing pages, custom mode gives you the most control. It removes all UI elements except the top navbar, giving you a blank canvas to build on. Custom mode pages have no default typography. Native HTML elements such as <h2> and <p> render with browser default styles, so style them explicitly with Tailwind CSS classes.
Example page frontmatter

Build a landing page

A typical landing page combines a hero section, feature cards, and calls to action.

Set up the page

Create an MDX file with custom mode:
Example landing page frontmatter

Create a hero section

Use HTML with Tailwind CSS classes to build a centered hero section:
Example hero section
Include both light and dark mode styles. Use dark: prefixed Tailwind classes to handle dark mode.

Add navigation cards

Use the Card and Columns components to create a grid of links below the hero section:
Example navigation cards

Use images with dark mode support

Show different images for light and dark mode using Tailwind’s visibility classes:
Example images with dark mode support

Use React components for interactive layouts

For reusable or interactive elements, define React components directly in your MDX file:
Example React component
Avoid using the style prop on HTML elements. It can cause a layout shift on page load. Use Tailwind CSS classes or a custom CSS file instead.
The web editor’s live preview does not generate CSS for page-specific Tailwind classes, so custom layouts can look unstyled while you edit them. Check your styling with mint dev, a preview deployment, or a production deployment. See Tailwind classes not applying in the editor’s live preview.

Add custom CSS

For styles that Tailwind doesn’t cover, add a CSS file to your repository. Mintlify applies CSS files site-wide, making their class names available in all MDX files. Use a custom CSS file when you need keyframe animations, complex selectors, or styles that apply across many pages. For one-off values, use a Tailwind arbitrary value such as w-[350px] instead.
Example custom CSS file
Then reference the class in your MDX:
Example custom CSS usage
See Custom scripts for more on custom CSS and the available CSS selectors.

Full example

Here’s a complete landing page that combines a hero section with navigation cards:
Example landing page

Tips

  • Test light and dark mode. Preview your custom layout in both light and dark mode to catch missing dark: styles.
  • Use max-w-* classes to constrain content width and keep text readable.
  • Keep it responsive. Use Tailwind’s responsive prefixes (sm:, md:, lg:) so your layout works on all screen sizes.
  • Combine modes. Use custom mode for your docs home page and default mode for everything else. You set the mode per page, so different pages can use different layouts.
  • Check for layout shifts. If elements jump on page load, replace inline style props with Tailwind classes or custom CSS.
  • Style components directly. Components accept a className prop, so you can adjust one instance without a wrapper element or a CSS override. See Style components with className.