RapiDoc Mini
<rapi-doc-mini> is a lightweight, zero-iframe Web Component designed to embed live, interactive OpenAPI endpoints directly into technical blog posts, markdown tutorials, changelogs, and microservice workflows without visual clutter.
The Problem with Traditional API Documentation
Blog & Tutorial Writing
Static markdown code snippets and screenshots go stale the moment an API schema changes. <rapi-doc-mini> reads directly from your source OpenAPI spec, guaranteeing your code examples and live consoles are always 100% up to date.
Step-by-Step Onboarding
When guiding a developer through a multistep journey (e.g. Register → Verify → Transact), you don't want to overwhelm them with 100 irrelevant endpoints. Pluck and display only the relevant endpoint at each step.
Microservice Storytelling
Modern architectures divide APIs across dozens of microservices. <rapi-doc-mini> allows you to pluck 1 endpoint from Billing, 1 from Identity, and 1 from Catalog into a unified narrative without merging backend specs.
Release Notes & Changelogs
Announce a new or deprecated endpoint in your product changelog by embedding the live interactive card directly into the release announcement with a working "TRY" console.
Seamless Blog & Guide Embedding
Just like an <img> tag, <rapi-doc-mini> drops directly into any HTML flow. Notice how it blends seamlessly with the page background, allowing you to trigger live API requests without being trapped inside an iframe or nested card:
<script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script>
<rapi-doc-mini
spec-url="/specs/reqres.yaml"
color-scheme="dark"
paths-expanded="false"
> </rapi-doc-mini>Placement, Sizing & Custom CSS Styling
Just like an <img> or <div> tag, <rapi-doc-mini> can be styled with standard CSS. You can easily constrain its width, apply custom border and border-radius, adjust padding, or attach box shadows to fit your exact layout requirements:
<!-- Custom width, golden border, table schema, and padding -->
<rapi-doc-mini
style="max-width: 650px; width: 100%; border: 2px solid #eab308; border-radius: 8px; padding: 12px; margin: 16px 0;"
spec-url="/specs/reqres.yaml"
color-scheme="dark"
schema-style="table"
layout="column"
paths-expanded="false"
> </rapi-doc-mini>
<!-- Compact single-endpoint card with salmon accent border -->
<rapi-doc-mini
style="max-width: 650px; width: 100%; border: 1px solid #f87171; border-radius: 6px; padding: 8px; margin: 16px 0;"
spec-url="/specs/reqres.yaml"
color-scheme="dark"
filter-operations="POST /users"
paths-expanded="false"
> </rapi-doc-mini>Selective Endpoint Filtering with filter-operations
Instead of rendering an entire specification, use filter-operations to display only the exact endpoint needed for your narrative (e.g. filter-operations="POST /users"). A method and path matches that path exactly, not the paths below it:
<rapi-doc-mini
spec-url="/specs/reqres.yaml"
color-scheme="dark"
paths-expanded="false"
filter-operations="POST /users"
> </rapi-doc-mini>Several Operations, Globs, Tags and Exclusions
filter-operations takes several terms, separated by spaces or commas. An operation is shown when it matches any term and no term that starts with !. A term is an operationId, a method and path, a path, a glob (* is one path segment, ** any number), tag:name, badge:label or deprecated. Operations keep the order of the terms they match:
<!-- A list of operations, shown in this order -->
<rapi-doc-mini
spec-url="/specs/reqres.yaml"
schema-style="table"
filter-operations="GET /users/{userId} POST /users"
> </rapi-doc-mini>
<!-- A glob: every operation under /pet -->
<rapi-doc-mini spec-url="/specs/petstore.json" filter-operations="/pet/**"> </rapi-doc-mini>
<!-- A tag, without one of its operations -->
<rapi-doc-mini
spec-url="/specs/petstore.json"
filter-operations="tag:store !DELETE /store/order/{orderId}"
> </rapi-doc-mini>
<!-- Everything except operations badged Internal, and deprecated ones -->
<rapi-doc-mini spec-url="/specs/api.yaml" filter-operations="!badge:Internal !deprecated"> </rapi-doc-mini>Always-Expanded Inline Mode (paths-expanded="true")
If click-to-expand accordion controls do not fit your article flow, set paths-expanded="true" to render parameters, request body schemas, and the live test console fully expanded:
<rapi-doc-mini
spec-url="/specs/reqres.yaml"
color-scheme="dark"
schema-style="table"
layout="column"
paths-expanded="true"
filter-operations="POST /users"
> </rapi-doc-mini>Multi-Spec Microservice Integration
Seamlessly weave endpoints from multiple independent OpenAPI specs into a cohesive story. Below, we embed an endpoint from a Syntax Highlighting service alongside an endpoint from a Petstore service in the same article:
<!-- Service A: Code Highlighting Service -->
<rapi-doc-mini
spec-url="/specs/code-highlight.yaml"
color-scheme="dark"
filter-operations="GET /code"
paths-expanded="false"
> </rapi-doc-mini>
<!-- Service B: Store & Inventory Service -->
<rapi-doc-mini
spec-url="/specs/petstore.json"
color-scheme="dark"
filter-operations="/store/**"
paths-expanded="false"
> </rapi-doc-mini>Handling Unavailable Specs (404 / Network Errors)
If an OpenAPI spec URL is missing, invalid, or returns a 404 HTTP status, <rapi-doc-mini> renders a clean built-in error message without throwing unhandled exceptions or breaking your page layout:
<!-- Graceful error rendering when a spec is unavailable or returns 404 -->
<rapi-doc-mini
spec-url="/specs/fake-non-existing.json"
color-scheme="dark"
> </rapi-doc-mini>Supported <rapi-doc-mini> Attributes
Configure any of the following HTML attributes directly on the custom element tag to control filtering, theming, layout, and authorization:
| Attribute | Type / Allowed | Default | Description |
|---|---|---|---|
spec-url | String | (empty) | URL of the OpenAPI specification file (JSON or YAML) to load and render. |
filter-operations | String | (empty) | Which operations to show: space- or comma-separated terms. An operationId, "GET /users", a path, a glob ("/store/**"), "tag:store", "badge:Beta" or "deprecated"; "!" before a term leaves it out. Empty shows every operation. |
paths-expanded | true | false | false | Controls whether matching endpoints are expanded by default or rendered as collapsible items. |
layout | row | column | row | Internal layout of endpoint details (side-by-side parameters and console, or stacked in a column). |
schema-style | tree | table | tree | Visual representation of request and response JSON schemas: interactive tree or structured table. |
schema-expand-level | Number | 999 | Initial expansion depth for nested schema models and properties. |
theme | dark | light | dark | Base color theme preset for the component. |
bg-color | Hex / CSS color | #1a1a1a | Custom background color for the component container, allowing seamless blending with your page. |
text-color | Hex / CSS color | (theme default) | Base text color for endpoint descriptions, labels, and parameters. |
primary-color | Hex / CSS color | #f3705a | Accent highlight color used for primary buttons, active tabs, and HTTP method badges. |
allow-try | true | false | true | Enables or disables the interactive "TRY" execution console. |
show-curl-before-try | true | false | false | Generates and displays copyable cURL commands directly in the card before execution. |
api-key-name | String | (empty) | Name of the API key header or query parameter to include in interactive requests. |
api-key-location | header | query | header | Target location where the API key value will be injected. |
api-key-value | String | (empty) | Value of the API key or bearer authorization token. |
server-url | String | (from spec) | Overrides the base API server URL for all requests made from the widget. |
regular-font | String | (system font) | Custom font family for body text and labels (e.g. "Outfit, sans-serif"). |
mono-font | String | (monospace) | Custom font family for code blocks, payloads, and parameter definitions. |
Component Comparison: <rapi-doc> vs. <rapi-doc-mini>
Understanding when to use the comprehensive full-portal <rapi-doc> component versus the lightweight, embeddable <rapi-doc-mini> widget:
| Feature / Goal | <rapi-doc> | <rapi-doc-mini> |
|---|---|---|
| Best for | A complete API reference, on its own page | One or a few endpoints inside a blog post, tutorial or changelog |
| Navigation sidebar and search | Yes | No |
| URL hash routing | Yes (update-route) | No: never changes the page URL |
| Tag names and descriptions | Always: tags are its sections and sidebar groups | Off by default (show-tags="true" turns them on) |
| Try console | Yes | Yes |
| Sizing | Fills the height you give it, usually the viewport | Grows with its content inside any container |
| Render modes | read, view and focused | One: the matched operations |
Ready to Integrate RapiDoc?
Check out our Quick Start for copy-paste integration recipes, or explore the complete API reference for full-portal documentation options.