Skip to main content

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.

OptionTypeDefaultPurpose
specobject or stringrequiredParsed OpenAPIOpenAPIA machine-readable standard for describing HTTP APIs, including their operations, parameters, request bodies, responses, and schemas. data, YAML, or JSON
basePathstring/URL prefix for operation, tag, and reference pages
themelight, dark, system, or inheritsystemRenderer color theme; inherit follows the host page
accentColorstring#6d5dfcAccent color used for focus and active states
showSidebarbooleantrueShow the navigation and filter sidebar
showApiVersionbooleantrueShow the API version in the overview heading
singleExpandedSidebarGroupbooleanfalseClose the previous sidebar group when another group opens
showThemeTogglebooleantrueShow the persistent light/dark theme control
tryItbooleantrueShow endpoint request builders and webhook testers
parameterPrototypebooleantrueSeparate required parameters from optional ones added on demand
showDeveloperHintsbooleanfalseShow authoring guidance and the API health drawer
previousSpecobject or stringnoneEarlier 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.
spectralDiagnosticsarraynoneSpectralSpectralAn 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
logoReact nodenoneBrand mark in the sidebar header; requires showSidebar
classNamestringemptyExtra class on the renderer root
onErrorfunctionnoneReceive 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.