asyncapi-viewer¶
Render AsyncAPI documents with one element:
<asyncapi-viewer src="asyncapi.yaml"></asyncapi-viewer>

asyncapi-viewer is a web component for rendering AsyncAPI 2 and 3 documents in the browser. Documents can be JSON or YAML and can come from a local file, URL, or in-memory object.
-
For python-based docs sites
pip install asyncapi-viewerA Python-Markdown extension with a plugin for MkDocs.
It also works with Zensical and other Python-Markdown hosts. The viewer is served from your site, local documents are checked at build time, and their contents are indexed for site search.
-
For web pages and app-based doc sites
npm install asyncapi-viewerOr load it directly from jsDelivr with a script tag.
The package provides a standard custom element with TypeScript types,
asyncapi-loadandasyncapi-errorevents, and a tested React integration.
This documentation site uses the MkDocs plugin. See the live demo.
What you get¶
- Any AsyncAPI document.
- AsyncAPI 2.x and 3.x, JSON or YAML, local file, URL or an in-memory object.
$refs to the document, other files, and URLs are resolved.- Payloads in JSON Schema or Avro become trees.
- Light and dark.
- Follows Material's colour scheme, the page's
data-themeor the system setting, live. - Two accent colours restyle it; see Customising.
- Follows Material's colour scheme, the page's
- Nothing fails silently.
- A document that cannot be loaded shows why, in place.
- Problems found in a document are listed in a Problems panel.
- In MkDocs a missing local file fails
mkdocs build --strict.
- Visible errors.
- Load failures are shown in the viewer.
- Problems found in a document are listed in a Problems panel.
- With MkDocs, missing local files fail mkdocs build --strict.
- Safe to embed.
- Renders into a shadow root and descriptions do not allow raw HTML.
- No inline scripts or styles are required (
script-src 'self'; style-src 'self'is enough)
- Accessible.
- Keyboard navigation, focus management for links into the viewer, screen reader announcements for search, and axe checks in CI.
Where next¶
Found it useful? Buy me a coffee.