OrbitDocs packages are coming to npm soon. Until then, run it from the GitHub repo →
Reference

MDX components

Every component you can use in guide pages without an import, with its props.

Guide pages (content/**/*.mdx) get these components without an import. They come from Fumadocs and from @orbitdocs/next/mdx (orbitMdxComponents). For how to use them in writing, see Components.

ComponentFromUse it for
CalloutFumadocsNotes, warnings and errors.
Cards, CardFumadocsLinked cards in a grid.
Steps, StepFumadocsNumbered procedures.
Tabs, TabFumadocsAlternatives, such as npm and pnpm.
Accordions, AccordionFumadocsCollapsible sections.
TypeTableFumadocsOptions and props tables.
EndpointOrbitDocsAn inline link to an API operation.
Code blocksFumadocsHighlighted code with titles, tabs and line marks.
op: linksOrbitDocsMarkdown links to API operations.

Callout

<Callout type="warn" title="Set basePath first">
  Links break when the base path doesn't match.
</Callout>
PropTypeDefaultWhat it does
type'info' | 'warn' | 'warning' | 'error' | 'success' | 'idea''info'Color and icon.
titleReactNodenoneBold first line.
iconReactNodethe type's iconReplaces the icon.

Cards and Card

<Cards>
  <Card title="Quickstart" href="/get-started/quickstart" description="Docs running in 5 minutes." />
  <Card title="GitHub" href="https://github.com/VitraAI/OrbitDocs" external />
</Cards>

Cards lays out its children in a grid. Card props:

PropTypeDefaultWhat it does
titleReactNoderequiredCard title.
descriptionReactNodenoneText under the title.
hrefstringnoneMakes the card a link.
externalbooleanfalseOpens the link in a new tab.
iconReactNodenoneIcon before the title.

A card can also take children as its body.

Steps and Step

<Steps>
<Step>
**Install the package.**
</Step>
<Step>
**Add the module.**
</Step>
</Steps>

No props. Each Step gets the next number. Leave a blank line inside a Step when it holds Markdown blocks such as code fences.

Tabs and Tab

<Tabs items={['npm', 'pnpm']}>
  <Tab value="npm">`npm install @orbitdocs/nestjs`</Tab>
  <Tab value="pnpm">`pnpm add @orbitdocs/nestjs`</Tab>
</Tabs>
ComponentPropTypeDefaultWhat it does
Tabsitemsstring[]noneTab labels, in order.
TabsdefaultIndexnumber0Tab selected first.
TabslabelReactNodenoneExtra label in the tab list.
Tabvaluestringfrom its positionMust match an entry of items.

Accordions and Accordion

<Accordions>
  <Accordion title="Does extraction start my database?" id="extraction-db">
    No. Nest preview mode instantiates no providers.
  </Accordion>
</Accordions>
PropTypeDefaultWhat it does
titleReactNoderequiredThe always-visible header.
idstringnoneAdds an anchor and a copy-link button. Opening the page with #id expands it.
valuestringthe titleIdentity of the item inside Accordions.

Content is hidden until opened, but browser find-in-page still finds it.

TypeTable

<TypeTable
  type={{
    path: { type: 'string', default: "'/docs'", description: 'URL path to serve under.' },
    root: { type: 'string', required: true, description: 'Folder with the build.' },
  }}
/>

type is an object of fields. Each field takes:

KeyTypeWhat it does
typeReactNodeShort type signature. Required.
descriptionReactNodeWhat the field does.
defaultReactNodeDefault value.
requiredbooleanMarks the field required.
deprecatedbooleanMarks the field deprecated.
typeDescriptionReactNodeFull type signature, shown on expand.
typeDescriptionLinkstringLink for the type.
parameters{ name: string; description: ReactNode }[]Parameters, for function types.
returnsReactNodeReturn value, for function types.

Endpoint

An inline link to one operation: a method badge and the path. It links to the operation in the reference.

Create one with <Endpoint api="demo" op="create-a-booking" />.

Create one with POST /v1/bookings.

PropTypeWhat it is
apistringThe API id from orbitdocs.config.ts.
opstringThe operation slug, as in the operation's URL (/reference/<api>/<op>/).

An unknown API or operation fails the build. orbitdocs check finds them first.

Any Markdown link whose target starts with op: points at an operation:

[Create a booking](op:demo/create-a-booking)
[The demo API](op:demo)

op:<api>/<operation> becomes /reference/<api>/<operation>/; op:<api> becomes /reference/<api>/. Broken targets are reported by orbitdocs check and fail orbitdocs build. See Linking operations.

Code blocks

Fenced code is highlighted with Shiki and gets a copy button. Options go after the language:

```ts title="src/main.ts" lineNumbers
mountOrbitDocs(app, { root: docs, path: '/docs' }); 
```
OptionExampleWhat it does
title="…"title="src/main.ts"File name above the code.
lineNumberslineNumbersShow line numbers.
tab="…"tab="npm"Consecutive blocks with tab become one tabbed block.
// [!code highlight]at the end of a lineHighlight that line.
// [!code ++], // [!code --]at the end of a lineMark a line as added or removed.
// [!code focus]at the end of a lineDim every other line.
// [!code word:basePath]on its own lineHighlight a word in the next line.

Use the comment style of the language (# in shell and YAML).

Markdown

GitHub-flavored Markdown works: tables, task lists, strikethrough and autolinks. Headings get anchors and appear in the table of contents.

GitHub alerts (> [!NOTE], > [!TIP], > [!IMPORTANT], > [!WARNING], > [!CAUTION]) render as callouts everywhere: guide pages, operation content (reference/<api>/*.mdx, @DocsContent) and descriptions from the spec. In MDX they become a Fumadocs Callout (info, success, idea, warning, error) through orbitMdxOptions() in lib/source.ts. See GitHub alerts.

Add your own components

The guides route passes its components to the page. Add yours next to the OrbitDocs ones:

app/(guides)/[...slug]/page.tsx
import { orbitMdxComponents } from '@orbitdocs/next/mdx';
import { createRelativeLink } from 'fumadocs-ui/mdx';

import { Diagram } from '@/components/diagram';

// …
components={orbitMdxComponents(orbit, { a: createRelativeLink(source, page), Diagram }) as Record<string, unknown>}

orbitMdxComponents(config, extra) merges extra over the defaults and keeps op: links working with whatever a you pass.

Landing sections

Section components for landing pages; they also work on any guide page. Each animates in on scroll and respects "reduce motion". Landing pages has an example of every one.

LandingAction is { text: string; href: string; icon?: string; variant?: 'primary' | 'secondary' | 'ghost' }. Icons are Lucide names (rocket) or Simple Icons brands (SiGithub). Heading props shared by Section, Features, Bento, Flow, Showcase, Comparison and ApiCards: eyebrow, title, description, align ('left' | 'center').

ComponentPropsWhat it renders
Herotitle, highlight?, description?, logo?: ReactNode, footnote?: ReactNode, badge?, badgeHref?, actions?: LandingAction[], align?: 'left' | 'center' (default left), backdrop?: 'glow' | 'grid' | 'glow-grid' | 'none' (default glow), children = visualPage header; text and buttons animate in on load.
HighlightchildrenWords in the brand gradient.
Sectionheading props, childrenA titled band for any content.
Features / Featurecolumns?: 2 | 3 | 4 (default 3) · icon?, title, href?, childrenCard grid with a pointer-following glow.
Bento / BentoItemheading props · size?: 'sm' | 'md' | 'lg' | 'full' (default md), tall?, icon?, title, description?, href?, children = visualSix-column asymmetric grid.
Terminallines: string[], title? (default Terminal), speed? (default 32 ms), loop?Typing terminal; $ lines are commands, # comments.
CodeShowcasetitle, description?, eyebrow?, actions?, reverse?, children = codeText beside code.
Flow / FlowStepheading props · icon?, title, childrenNumbered steps on a line that draws itself.
Showcase / ShowcaseItemheading props, interval? (default 6000 ms) · title, description?, icon?, children = visualAuto-playing tabbed product tour.
BrowserFramesrc?, srcDark?, url?, alt?, tilt? (default true), childrenBrowser window around a screenshot.
Stats / Statvalue, labelBig numbers that count up.
Comparisonheading props, columns: string[], rows: { feature, values: (boolean | string)[], note? }[], highlight? (default 0)Feature table with ✓ and –.
ApiCardsheading props, ids?: string[]One card per configured API.
Logos / Logotitle?, marquee? · name, src?, icon?, href?Logo row or endless marquee.
CallToActiontitle, description?, actions?Closing banner with a turning gradient border.
LinkButtonhref, variant?, icon?, childrenA single button.

For your own animated components, @orbitdocs/next also exports Reveal, RevealGroup and RevealItem (scroll-in animations) and CountUp.

Last updated on

On this page