Configuration
Pass these options to the React Speccy component or to the Docusaurus OpenAPI component. Generated Docusaurus routes accept them beneath renderer.
Test API requests explains tryIt and parameterPrototype. Review API health covers showDeveloperHints, previousSpec, and spectralDiagnostics.
| Option | Type | Default | Purpose |
|---|---|---|---|
spec | object or string | required | Parsed OpenAPIOpenAPIA machine-readable standard for describing HTTP APIs, including their operations, parameters, request bodies, responses, and schemas. data, YAML, or JSON |
basePath | string | / | URL prefix for operation, tag, and reference pages |
theme | light, dark, system, or inherit | system | Renderer color theme; inherit follows the host page |
accentColor | string | #6d5dfc | Accent color used for focus and active states |
showSidebar | boolean | true | Show the navigation and filter sidebar |
showApiVersion | boolean | true | Show the API version in the overview heading |
singleExpandedSidebarGroup | boolean | false | Close the previous sidebar group when another group opens |
showThemeToggle | boolean | true | Show the persistent light/dark theme control |
tryIt | boolean | true | Show endpoint request builders and webhook testers |
parameterPrototype | boolean | true | Separate required parameters from optional ones added on demand |
showDeveloperHints | boolean | false | Show authoring guidance and the API health drawer |
previousSpec | object or string | none | Earlier document used to surface potentially breaking changesBreaking changeA change to an API contract that can make an existing client integration stop working or behave differently. |
spectralDiagnostics | array | none | SpectralSpectralAn open source linter for JSON and YAML documents. Speccy uses Spectral rules to report OpenAPI quality and consistency problems. results shown alongside Speccy's built-in guidance |
logo | React node | none | Brand mark in the sidebar header; requires showSidebar |
className | string | empty | Extra class on the renderer root |
onError | function | none | Receive parsing and model errors |
Hosts that own routing can also pass route, onNavigate, and hrefForRoute to control navigation instead of letting Speccy write to browser history.
Set info.x-icon in the OpenAPIOpenAPIA machine-readable standard for describing HTTP APIs, including their operations, parameters, request bodies, responses, and schemas. document to show a brand mark beside the API title in the sidebar header, so it appears only when showSidebar is on. Speccy displays the image as supplied without adding a background. An explicit logo component prop takes precedence.
info:
title: Luma Library API
x-icon:
url: /img/luma.svg
alt: Luma
The Docusaurus integration ships defaults that differ from this table. The OpenAPI component and generated routes both default theme to inherit and showThemeToggle to false, so the reference follows the site's color mode. The OpenAPI component also hides the sidebar (showSidebar: false), and generated routes enable showDeveloperHints during development builds.
Theme
system follows the visitor’s operating-system preference; inherit follows the surrounding page's theme instead. The renderer scopes its theme variables, so it can sit inside a Docusaurus page without changing the surrounding site.
<Speccy spec={spec} theme="dark" accentColor="#ff735d" />
Embedded references
Hide the sidebar when the surrounding application already supplies navigation:
<Speccy spec={spec} showSidebar={false} />
Hiding the sidebar removes its navigation filter, though the Cmd/Ctrl+K quick search still works. For a complete reference with stable endpoint pages, keep the sidebar enabled and mount Speccy on its own route.