Skip to content

nisabmohd/aria-docs / skills/ariadocs-components

ariadocs-components

Verified

Build and customize docs UI with @ariadocs/components — the Docs.* layout (sidebar, mobile nav, table of contents, page), the OpenAPI.* API reference parts, theming with --aria-* CSS variables, and MDX content components such as Callout, Tabs, Steps and Cards (which the package does not include). Use when the user wants to change a docs layout, add a mobile menu, hide or reorder parts of an endpoint page, theme the components, add callouts/tabs/steps/cards to MDX, or compose custom API reference pages. For loading MDX content use the `ariadocs-mdx` skill; for parsing OpenAPI specs and reference routes use `ariadocs-openapi`.

FileKindSize
SKILL.mdskill md8.0 KB
references/mdx-components.mdmarkdown5.7 KB
references/migration.mdmarkdown355 B
references/openapi.mdmarkdown3.3 KB

references/openapi.md

View on GitHub
# OpenAPI components

All parts are Client Components that take plain data. `api` comes from `openapi.parse()` (`@ariadocs/openapi`).

`OpenAPI.Root` is required for `OpenAPI.Docs`, `OpenAPI.Info`, `OpenAPI.Sidebar` and for lookups by `id` or `name`. Parts given their data directly (`operation={op}`, `schema={schema}`, `parameter={p}`, `response={r}`) work without it.

## Parts

| Component | Props | Children parts |
| --- | --- | --- |
| `OpenAPI.Root` | `api`, `operationBaseHref?` (e.g. `"/reference"` → `/reference/<id>`; without it, `#id` anchors) | anything |
| `OpenAPI.Docs` | `showSidebar?`, `showSchemas?` | — (whole API on one page) |
| `OpenAPI.Info` | `className?` | — |
| `OpenAPI.Sidebar` | `activeHref?`, `linkAs?`, `onNavigate?` | — |
| `OpenAPI.Operation` | `id?` or `operation?`, `headingLevel?` (1–3) | `.Tag`, `.Title` (`level`), `.Header`, `.Method`, `.Path`, `.Deprecated`, `.Summary`, `.Description`, `.Security`, `.Parameters`, `.RequestBody`, `.Responses`, `.Examples`, `.RequestExample` (`languages`), `.ResponseExample` |
| `OpenAPI.Parameter` | `parameter?` | `.Header`, `.Name`, `.In`, `.Required`, `.Description`, `.Details`, `.Schema`, `.Example` |
| `OpenAPI.RequestBody` | `requestBody?` | `.Description`, `.Content` |
| `OpenAPI.Response` | `response?` | `.Status`, `.Description`, `.Headers`, `.Content` |
| `OpenAPI.Schema` | `name?` or `schema?`, `mode?` (`"request"` hides readOnly, `"response"` hides writeOnly) | `.Title` (`id`), `.Description`, `.Properties` |
| `OpenAPI.Security` | `security?` | — |
| `OpenAPI.Server` | `servers?` | — |
| `OpenAPI.Method` | `method`, `size?`, `variant?` (`badge`, `text`) | — |
| `OpenAPI.Code` | `code`, `language?`, `title?`, `actions?` | — |
| `OpenAPI.Markdown` | `children` (string) | — |

Without children, each component renders its full default layout. With children, it renders only the parts you list, in your order, and you can put your own elements between them.

## Recipes

Endpoint page without code examples:

```tsx
<OpenAPI.Operation id={id} headingLevel={1}>
  <OpenAPI.Operation.Title level={1} />
  <OpenAPI.Operation.Header />
  <OpenAPI.Operation.Description />
  <OpenAPI.Operation.Parameters />
  <OpenAPI.Operation.RequestBody />
  <OpenAPI.Operation.Responses />
</OpenAPI.Operation>
```

Only some request languages: `<OpenAPI.Operation.RequestExample languages={["curl", "javascript"]} />` (see `CODE_SAMPLE_LANGUAGES` from `@ariadocs/openapi` for ids).

A schema page:

```tsx
<OpenAPI.Root api={api}>
  {Object.keys(api.schemas).map((name) => (
    <OpenAPI.Schema key={name} name={name}>
      <OpenAPI.Schema.Title id={`schema-${name}`} />
      <OpenAPI.Schema.Properties />
    </OpenAPI.Schema>
  ))}
</OpenAPI.Root>
```

Your own part, using a hook inside the matching component:

```tsx
"use client"
import { useOperation } from "@ariadocs/components"

export function OperationId() {
  return <code className="text-muted-foreground text-xs">{useOperation().operationId}</code>
}
```

Hooks: `useOpenAPI()` (inside `Root`), `useOperation()`, `useParameter()`, `useResponse()`, `useSchema()`.

## Sidebar for endpoint pages

Either `<OpenAPI.Sidebar />` inside `Root` with `operationBaseHref`, or build `NavItem[]` and use `Docs.Nav` (lets you merge it with MDX docs):

```ts
const nav = await openapi.getNavigation({ getOperationHref: (op) => `/reference/${op.id}` })
```
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall