Skip to content
English
Docs article comes with Pro. Its preview shows once you unlock it.

Usage

import { DocsArticle } from './DocsArticle.jsx'

// Render a page from your content; sections hold paragraphs, code samples and callouts:
<DocsArticle
  locale="en"
  article={page}               // { section, title, lead, updated, sections: [{ id, title, body }] }
  prev={{ title: 'Retries', href: '/docs/retries' }}
  next={{ title: 'Events', href: '/docs/events' }}
  loading={!page}
  error={pageError}
  onRetry={reload}
/>

Props

PropTypeDefaultWhat it does
locale'en' | 'zh-CN' | 'es' | 'ja''en'Language of the built-in text and the sample article.
article{ section?, title, lead?, updated?, sections: [{ id, title, body }] }sample articleThe page. A body part is { type: "p", text }, { type: "code", samples: [{ lang, code }] } or { type: "callout", tone, title, text }. No sections shows the empty state.
prev / next{ title, href? } | nullsample pagesThe pages before and after; null hides one.
defaultLanguagestringfirst sample’s languageThe code language selected at first, for example the visitor’s last choice.
loading / errorboolean / boolean | stringfalseShow the skeleton, or the error banner with a retry button (a string replaces its sentence).
onNavigate / onRetry(page, direction) => void / () => void—Previous or next was chosen (without it the links follow their href); retry was pressed.
labelsobject—Replaces any built-in text (keys as in copy.js).

Add it to your project

Pro includes the full source of this block. Copy its prompt to install it with your coding agent.

DocsArticle.jsxdocs-article.csscopy.jskit.jsxkit.cssui/base-button/ui/copy-button/ui/empty-state/ui/alert-banner/ui/callout/ui/skeleton-shimmer/ui/sliding-tabs/tokens.cssREADME.md

The block, its stylesheet and text, the shared kit, the components it uses and tokens.css install together into one folder.