NavLinks

The NavLinks component can be used to render a list of routes in the sidebar.

// example Root component
import React from 'react'
import {
  Layout,
  NavLinks
} from 'mdx-go'

export const Root = props =>
  <Layout>
    <Layout.Sidebar>
      <NavLinks {...props} />
    </Layout.Sidebar>
    <Layout.Main>
      {props.children}
    </Layout.Main>
  </Layout>

Props

PropTypeDescription
routesarray (required)Array of mdx-go route objects passed to the Root component
orderarrayArray of route names to sort the links
filterfunctionOptional function to filter routes
fontSizenumber, string, or arrayChanges the links' font size
colorstringChanges the links' color
bgstringChanges the links' background color
cssobject or stringAdditional CSS to pass to the links
spacenumber, string, or arrayAll styled-system space props are passed to the links