Web component that generates interactive API documentation and live playgrounds for custom elements / web components. It parses custom-elements.json manifest and renders property, attribute, method, event, and slot documentation alongside a live demo editor. Version 1.0.0-pre.10 is the latest pre-release, with patches updating demo copy button styles. Key differentiator: fully custom-element-based, works in any framework or vanilla HTML, built on LitElement. Alternatives like Storybook or Docz typically require framework-specific integrations. Ships TypeScript types (from @open-wc). Part of Open Web Components ecosystem.
npm install api-viewer-elementVerified import paths — ran on the pinned version, not inferred.
Shows how to use the <api-viewer> element: import the web component, fetch a custom-elements.json manifest, and set it as a property. The component renders documentation and a live demo.
Generate a manifest using @custom-elements/manifest or similar tool.
Fetch the JSON and assign the parsed object to the `manifest` property.
Pin to a specific pre-release version and test updates carefully.
Ensure the manifest URL is valid and the server allows CORS. For local testing, use a local server or inline the manifest.
Check that the manifest is properly parsed JSON and contains the expected structure (e.g., tags array).
Ensure you have imported 'api-viewer-element' before using the <api-viewer> tag.