Blocks Design System

Writing docs pages

Each page is MDX under apps/docs/app, listed in app/nav.ts in reading order. The sidebar and the previous and next links read that manifest.

Examples

An example is a file under apps/docs/examples that default-exports one component. <Example> renders it live and shows the same file’s source, so the preview and the code cannot drift apart.

mdx
<Example src="writing-docs/release-status.tsx" title="Release status" />

Release candidate 0.1.0-rc.0 is ready to verify.

Source · writing-docs/release-status.tsx
writing-docs/release-status.tsx
export default function ReleaseStatus() {
  return (
    <p role="status">
      Release candidate <strong>0.1.0-rc.0</strong> is ready to verify.
    </p>
  )
}
Release status
  • Import from @blocks/design-system, never from package source paths.
  • Add "use client" when the example uses state, effects or the dot API of a client component. Named parts work from a Server Component.
  • Keep each file to one idea, with realistic content.

Agents read the same page

Every page is also served as Markdown, listed in llms.txt and readable through the docs’ MCP server; see Using the docs from an agent. The Markdown is the page’s own MDX with each component replaced by a fixed form, so:

  • Give the page a description in its metadata, or open it with a paragraph that says what it’s for. llms.txt and the HTML <head> both use it.
  • A new MDX component needs a Markdown form in apps/docs/agents/components.ts. Without one, the docs build fails rather than leaving it out of the Markdown.
  • Write {expressions} in code, not in prose: they have no Markdown form either.