Choose a page mode
Set themode 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.
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 withcustom mode:
Example landing page frontmatter
Create a hero section
Use HTML with Tailwind CSS classes to build a centered hero section:Example hero section
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
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.Tailwind CSS arbitrary values (for example,
w-[350px]) are not supported. Use a custom CSS file for values that Tailwind’s utility classes don’t cover.Example custom CSS file
Example custom CSS usage
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
custommode for your docs home page anddefaultmode 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
styleprops with Tailwind classes or custom CSS.