ArdoRoot
Sur cette page
Cette référence API est générée à partir des commentaires TypeScript en anglais. Les noms, signatures et exemples correspondent au paquet publié.
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
| Name | Type | Required | Description |
|---|---|---|---|
config | ArdoConfig | No | The site config. Ardo's entries provide it from ardo.config.ts, so aroot component can leave it out; pass it in tests and previews. |
components | ArdoMDXComponents | No | Add to or override the default Markdown component set, including its wrapper. |
theme | ArdoThemeProps | No | Hues, saturation, callout hues, fonts, and design tokens; see ArdoTheme. |
logo | ArdoLogo | No | Header and mobile menu logo. Import the file, import logo from "./assets/logo.svg",so Vite fingerprints it; { light, dark } switches with the color scheme. |
icon | string | No | Favicon, usually an imported SVG or PNG. Without it, Ardo links its generated owl icons. |
appleTouchIcon | string | No | 180×180 PNG for iOS home screens. Defaults to the generated owl icon. |
editLink | { pattern: string; text?: string } | No | Edit link configuration (applied site-wide via ArdoSiteConfig) |
lastUpdated | { enabled?: boolean; text?: string; formatOptions?: Intl.DateTimeFormatOptions } | No | Last updated configuration (applied site-wide via ArdoSiteConfig) |
labels | ArdoLabelsInput | No | UI chrome labels and aria text, merged with English defaults. |
tocLabel | string | No | TOC label (applied site-wide via ArdoSiteConfig) |
className | string | No | Additional CSS classes for the layout |
scrollMode | ArdoScrollMode | No | Choose the viewport shell (default) or let the document scroll. |
header | false | ReactNode | No | Site header in place of an ArdoHeader child: your own component, orfalse for no header. Children can only name Ardo's own header. |
footer | false | ReactNode | No | Site footer in place of an ArdoFooter child: your own component, orfalse for no footer. Without either, Ardo renders its default footer. |
sidebar | false | ReactNode | No | Sidebar in place of an ArdoSidebar child, or false for no sidebar.Without either, Ardo renders one section per top-level route folder. |
children | ReactNode | No | Site 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>
)
}