Skip to content
PreviewTry search or open the full-size view to see the navigation and outline side by side.

Loading product docs

Open full-size docs

TSX
import Markdown from "react-markdown";
import remarkGfm from "remark-gfm";
import { PageFeedback } from "@arcadia/ui/docs-shell";
import { DocsArticle, DocsShell } from "@arcadia/ui/web/docs";
import "@arcadia/ui/docs-shell.css";

<DocsShell
  name="Product"
  nav={tree}
  index="/docs/search.json"
  path={path}
  navigate={(href) => router.push(href)}
  signedIn={session != null}
  hosts={{ arcadia: "https://arcadia.is" }}
>
  {page}
</DocsShell>

<DocsArticle
  {...facts}
  body={markdown}
  tasks={taskLinks}
  reader={{ Markdown, plugins: [remarkGfm] }}
  feedback={<PageFeedback onVerdict={sendVerdict} onNote={sendNote} />}
  contact="help@example.com"
/>

Pass the product's navigation, search index and footer to DocsShell.

Long page names wrap in the navigation.

Pass Markdown and the product's parser to DocsArticle. Use tasks for the first links a reader needs.

Static pages

Render the shell and article to HTML at build time.

TSX
const html = renderToString(<Docs {...props} />);

hydrateRoot(document.getElementById("docs")!, <Docs {...props} />);

Hydrate with the same props and reader. Search loads its index on demand.

With no script

Use noScript to omit controls that need JavaScript.

TSX
const html = renderToString(
  <DocsShell name="Product" nav={tree} index={[]} path={path}
    hosts={hosts} noScript>
    <DocsArticle {...facts} body={markdown} reader={reader} />
  </DocsShell>,
);

On narrow screens, Menu opens the page list in a native dialog. If the browser cannot open it, use Browse documentation after the article.

Examples

A code block

Copy a fenced example without tabbing through its source.

Preview
tsx
await team.messages.send({
  text: "Deploy finished",
});

Article without script

Compare the rendered article without search, appearance or copy controls.

Preview

Navigation, main content and the article outline each have named landmarks.

The shortcut shown in the bar or / opens search. Arrow keys move through results and Enter opens one.

Without JavaScript, the skip link still leads to main.

DocsShell

namerequired
string
base
string
Default: "/docs"
navrequired
DocsGroup[]
indexrequired
DocsIndex
suggested
string[]
pathrequired
string
navigate
(href: string) => void
signedIn
boolean
Default: false
hostsrequired
{ arcadia: string; home?: string }
pinnedTheme
"light" | "dark" | null
pinnedMotion
"on" | null
noScript
boolean
Default: false
footer
ReactNode

slugrequired
string
pathrequired
string
markdownrequired
string
sectionrequired
string
titlerequired
string
descriptionrequired
string
bodyrequired
string
referencerequired
boolean
tasks
readonly Pick<ArticleLink, "href" | "title">[]
relatedrequired
ArticleLink[]
prev
{ href: string; title: string; description?: string }
next
{ href: string; title: string; description?: string }
readerrequired
{ Markdown: (props: DocsReaderProps) => ReactNode; plugins?: readonly unknown[] }
feedback
ReactNode
contact
string