Header and footer

View as Markdown
Pro and Enterprise feature

This feature is available only for the Pro and Enterprise plans. To get started, reach out to support@buildwithfern.com.

Replace Fern’s default header or footer with your own React components. Components are server-side rendered for better SEO and performance, with no layout shifts.

1

Create your component

Your component file must have a default export returning a React component. Tailwind CSS classes are available, including the dark: prefix for dark mode styles (e.g., dark:bg-gray-900, dark:text-gray-400):

components/CustomFooter.tsx
1export default function CustomFooter() {
2 return (
3 <footer className="w-full py-8 px-6 bg-gray-100 dark:bg-gray-900">
4 <div className="max-w-7xl mx-auto">
5 Plant Store API Documentation
6 </div>
7 </footer>
8 );
9}
2

Add the component paths to docs.yml

docs.yml
1header: ./components/CustomHeader.tsx
2footer: ./components/CustomFooter.tsx
3

Specify your components directory in docs.yml

Add your components directory to docs.yml so that the Fern CLI can scan your components directory and upload them to the server.

docs.yml
1experimental:
2 mdx-components:
3 - ./components