Skip to content
CtrlK

ArdoRoot

On this page

The whole site around the page: header with search, a sidebar with one section per route folder, the page, and the footer. Render it in app/root.tsx; pass ArdoHeader, ArdoSidebar, or ArdoFooter as children to change a part.

import { ArdoRoot } from "ardo/ui"

<ArdoRoot>{children}</ArdoRoot>

Props

NameTypeRequiredDescription
configArdoConfigNoThe site config. Ardo's entries provide it from ardo.config.ts, so a
root component can leave it out; pass it in tests and previews.
componentsArdoMDXComponentsNoAdd to or override the default Markdown component set, including its wrapper.
editLink{ pattern: string; text?: string }NoEdit link configuration (applied site-wide via ArdoSiteConfig)
lastUpdated{ enabled?: boolean; text?: string; formatOptions?: Intl.DateTimeFormatOptions }NoLast updated configuration (applied site-wide via ArdoSiteConfig)
labelsArdoLabelsInputNoUI chrome labels and aria text, merged with English defaults.
tocLabelstringNoTOC label (applied site-wide via ArdoSiteConfig)
classNamestringNoAdditional CSS classes for the layout
scrollModeArdoScrollModeNoChoose the viewport shell (default) or let the document scroll.
headerfalse | ReactNodeNoSite header in place of an ArdoHeader child: your own component, or
false for no header. Children can only name Ardo's own header.
footerfalse | ReactNodeNoSite footer in place of an ArdoFooter child: your own component, or
false for no footer. Without either, Ardo renders its default footer.
sidebarfalse | ReactNodeNoSidebar in place of an ArdoSidebar child, or false for no sidebar.
Without either, Ardo renders one section per top-level route folder.
childrenReactNodeNoSite chrome children: ArdoHeader, ArdoSidebar, ArdoFooter, and optional content overrides.

Props type: ArdoRootProps

Example

Minimal usage: header with search, a generated sidebar, and the footer

export default function Root() {
  return <ArdoRoot />
}

Example

With JSX chrome

export default function Root() {
  return (
    <ArdoRoot>
      <ArdoHeader>
        <ArdoNav>
          <ArdoNavLink to="/guide">Guide</ArdoNavLink>
        </ArdoNav>
      </ArdoHeader>
      <ArdoSidebar>
        <ArdoSidebarSection id="guide" label="Guide" to="/guide">
          <ArdoGeneratedSidebar section="guide" />
        </ArdoSidebarSection>
      </ArdoSidebar>
      <ArdoFooter message="Released under the MIT License." />
    </ArdoRoot>
  )
}