Skip to content
RapiDocv11.0
GitHub

RapiDoc Mini (Embedded Endpoint Cards)

While <rapi-doc> provides a full-page documentation portal with sidebars, global navigation, and search modals, <rapi-doc-mini> is a dedicated lightweight Web Component designed to render isolated endpoints or filtered sub-groups.

It is ideal for embedding interactive “TRY” cards directly inside tutorials, changelogs, markdown blog posts, or internal wiki pages without using clunky <iframe> wrappers.


Import the ES module from unpkg or your local build, then specify spec-url and use match-paths to isolate the target endpoint:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script>
</head>
<body>
<!-- Renders only the POST /users endpoint from the OpenAPI specification -->
<rapi-doc-mini
spec-url="https://petstore.swagger.io/v2/swagger.json"
match-paths="post /user"
color-scheme="dark"
paths-expanded="false"
> </rapi-doc-mini>
</body>
</html>

Extract a single path and HTTP method:

<rapi-doc-mini
spec-url="https://petstore.swagger.io/v2/swagger.json"
match-paths="get /pet/{petId}"
theme="dark"
allow-try="true"
></rapi-doc-mini>

Every attribute can be set statically in HTML or updated dynamically at runtime via JavaScript element.setAttribute(...).

Attribute Type / Options Default Description
spec-url String "" URL to the OpenAPI specification (JSON or YAML).
match-paths String "" Target path and method filter (e.g. "post /users" or "/store").
match-type includes | regex includes Matching strategy for match-paths.
paths-expanded true | false false When true, renders operation details expanded by default.
layout row | column row Internal flex alignment of parameters and response console.
schema-style tree | table tree Schema rendering mode: collapsible tree or structured table.
schema-expand-level Number 999 Default expansion depth for request and response schema models.
theme dark | light dark Base theme preset.
bg-color Hex / CSS color (preset) Background surface color for the widget container.
text-color Hex / CSS color (preset) Primary text and label color.
primary-color Hex / CSS color #f3705a Accent color for buttons, badges, and active tabs.
allow-try true | false true Toggles the interactive execution test console.
show-curl-before-try true | false false Displays copyable cURL syntax before executing a request.
api-key-name String "" Name of the authentication header or query parameter.
api-key-location header | query header Location for the API credential.
api-key-value String "" Active API token or bearer secret.
server-url String (from spec) Overrides the target server URL for live requests.
sort-endpoints-by path | method | summary | none none Sorting order for operations when multiple paths match.

4. Component Comparison: <rapi-doc> vs. <rapi-doc-mini>

Section titled “4. Component Comparison: <rapi-doc> vs. <rapi-doc-mini>”
Feature / Goal<rapi-doc><rapi-doc-mini>
Primary Use CaseFull-page developer portal & complete API reference manualIsolated inline endpoint cards for blogs, tutorials & changelogs
Navigation SidebarIncluded (search bar, tag grouping, operation list)None (pure endpoint content without navigation chrome)
URL Hash RoutingYes (updates browser address hash via update-route)Disabled (won't alter host page URL)
Interactive TRY ConsoleYesYes
Container FlexibilityTypically full viewport height or dedicated portal frameResponsive, adapts naturally to any parent <div> container
Multi-Spec MashupSingle spec per instanceMultiple instances with different specs on the same page
Footprint & LayoutComplete portal layout (focused, view, read modes)Compact, zero-iframe inline element with no external chrome