Attributes
Every attribute of <rapi-doc>, read from the element’s own source, so this page matches the release it is built from. Set one on the element in HTML, or change it at runtime with setAttribute. The rest of the reference: Methods, Events, Slots, Spec Extensions and CSS Parts & Variables.
An attribute from an earlier version that is not listed here was removed: Removed attributes says when, and what to use instead.
Nothing on this page matches.
Spec & Content Attributes 6
| Attribute | Description and allowed values | Default |
|---|---|---|
spec-url | URL of the OpenAPI specification file (JSON or YAML) to load and render. | (empty) |
sort-tags |
Sorts tags in alphabetical order. When set to "false", preserves the tag order defined in the
OpenAPI specification. | false |
sort-schemas |
Sorts component schemas alphabetically. When set to "false", preserves the order defined in the
spec. Note: Only has an effect if render-style="focused" and show-components="true". | false |
sort-endpoints-by |
Sorts endpoints within each tag group by path, HTTP method, or summary. 'none' leaves the sort
order unmodified. See it running →ⓘ This is a static initialization attribute. It will not have any effect if modified using JavaScript after the spec is rendered. | path |
show-unused-tags |
Shows tags that no operation uses, as long as they have a description, so a tag can hold a guide or concepts section (written in
markdown) next to the operations. Each such tag gets a section and a sidebar link. When
"false", tags without operations are left out, except those the spec lists in x-tagGroups, which show either way. Either way, an OpenAPI 3.2 tag that is the
parent of other tags is drawn as their group's heading, not
as a section, and a tag whose kind is not nav never gets one. ⓘ This is a static initialization attribute. It will not have any effect if modified using JavaScript after the spec is rendered. | false |
filter-operations | Which operations to show: a space- or comma-separated list of terms. An operation is shown when
it matches any include term (every one is, without one) and no ! term. A term is an operationId (getPetById), a
method and path (GET /pet/{petId}), a path for all its methods,
a path glob (/pet/**; * is one
segment, ** any number), tag:store, badge:Beta (an x-badges label, or an OpenAPI 3.2 tag of kind: badge) or
deprecated; ! before a term
leaves out what it matches (!badge:Internal). Shown operations
keep the order of the first term they match, so a list of operationIds shows them in that
order (unless sort-endpoints-by is set). See it running → | (empty) |
Layout & Scrolling Attributes 4
| Attribute | Description and allowed values | Default |
|---|---|---|
render-style |
Controls the overall documentation presentation layout. Three distinct modes are supported:
| read |
layout |
Controls the multi-column orientation of request parameters and response panels on desktop
screens (>768px). In 'row' layout, request and response sections sit side-by-side; in 'column'
layout, they stack vertically. Defaults to 'column' when render-style is 'read' or 'focused',
and 'row' when render-style is 'view'. | column (read, focused) / row (view) |
response-area-height | Allowed: Any valid CSS height value (e.g. 400px, 50%,
60vh). Controls the vertical height of the interactive response payload viewer. | 400px |
scroll-offset | Allowed: A number of pixels (e.g. 96). With auto-height="true", where the page scrolls instead of RapiDoc, this is the height
of a sticky or fixed page header. Navigation scrolls a section to just below it, and the active
navigation item ignores sections hidden under it. When not set, RapiDoc uses the scroll root's
scroll-padding-top, so a page that already sets it needs no extra configuration. | (scroll-padding-top of the page) |
Theme Attributes 4
| Attribute | Description and allowed values | Default |
|---|---|---|
theme |
Brand color preset, or a custom brand color as a hex code. Each preset defines a dark and a
light palette. See it running → | amber |
color-scheme |
Base color scheme mode. 'system' automatically matches the user's OS preference. 'auto' follows
the host page: it reads the page's CSS color-scheme (for example
:root[data-theme='light'] { color-scheme: light }, as Starlight sets it) and
updates when the page switches theme; when the page declares none, it falls back to the OS
preference. | dark |
radius |
Corner radius scale applied across cards, buttons, badges, inputs, and dialogs. | sm |
scale |
Relative scale factor for typography and UI elements across the documentation portal. | default |
Sidebar & Navigation Attributes 8
| Attribute | Description and allowed values | Default |
|---|---|---|
show-side-nav |
The navigation sidebar (read and focused modes). true docks
it beside the content on wide layouts and turns it into a menu button with a slide-over menu
when the element is narrower than 768px; floating uses the
menu button and slide-over menu at every width, so the content takes the whole width;
false shows no sidebar. | true |
show-method-in-nav-bar |
Shows each operation's HTTP method (GET, POST, etc.) at the start of its sidebar item, in a
column of its own: as plain text, colored text, or a colored block with a three-letter method.
false shows the summary alone. See it running → | as-colored-text |
show-badges-in-nav-bar |
Marks sidebar items whose operation shows a badge (x-badges,
or an OpenAPI 3.2 tag of kind: badge) with a small dot in the first badge's color; its tooltip
and accessible label list the badges. Badges with color: none
are left out. The dot's shape and size can be styled with the nav-badge-dot CSS part. See it running → | dot |
use-path-in-nav-bar |
Displays raw API URL paths in the navigation bar instead of operation summaries. See it running → NOTE: Setting this to true displays the path only. To display the HTTP method alongside the path, also
configure show-method-in-nav-bar. | false |
nav-item-overflow |
Controls text truncation behavior for long endpoint paths and operation summaries in the
navigation sidebar. When set to ellipsis (default), long paths
truncate with a clean ellipsis. When set to wrap, long items
wrap across multiple lines without clipping. | ellipsis |
info-description-headings-in-navbar |
Extracts Markdown headings (H1 and H2) from the specification's info description and adds them
to the sidebar navigation menu (read mode only). See it running → | false |
update-route |
When set to "true", automatically updates the browser's URL address hash as the user scrolls
through or clicks on different sections. | true |
goto-path | Target endpoint location to navigate to automatically after the specification finishes loading.
Must be provided in the format of {method}-{path} (e.g., to
focus on GET /user/login, provide get-/user/login). | (empty) |
Header & Sections Attributes 9
| Attribute | Description and allowed values | Default |
|---|---|---|
show-header |
Toggles the top navigation header bar. Set to false to
prevent users from loading alternative spec URLs or to seamlessly embed inside existing
layouts. | true |
heading-text | Custom title text displayed on the top-left corner of the header. | (empty) |
show-info |
Toggles visibility of the OpenAPI document info section (title, description, version, terms of
service). Useful when embedding ` | true |
show-components |
Toggles the components section (schemas, responses, examples, request bodies, headers, security
schemes) in both the document body and sidebar menu (available in focused render-style). | false |
allow-search |
Enables the instant search and filtering input in the navigation sidebar. | true |
allow-advanced-search |
Enables deep multi-property search modal, indexing paths, descriptions, parameter names, and
response schemas. See it running → | true |
allow-spec-url-load |
When set to false, disables the input field allowing users
to load arbitrary external OpenAPI specification URLs. | true |
allow-spec-file-load |
When set to false, hides the file picker allowing users to
upload and preview local OpenAPI spec files (desktop viewports >768px). | true |
allow-spec-file-download |
When set to true, displays convenient buttons in the
overview section to download the raw OpenAPI specification file or view it in a new tab. | false |
Schemas Attributes 7
| Attribute | Description and allowed values | Default |
|---|---|---|
schema-style |
Controls the visual representation of complex JSON schemas in request and response panels.
'tree' provides an interactive collapsible tree view; 'table' renders structured tabular rows. See it running → | tree |
schema-expand-level | Initial depth level for auto-expanding complex nested schema properties and sub-objects (the
default expands all levels). See it running → | 99999 |
schema-description-expanded |
Controls whether schema field constraints, validation rules, and descriptions are fully
expanded by default or collapsed to a single line. | false |
allow-schema-description-expand-toggle |
Shows or hides the button allowing users to toggle between single-line summary and multi-line
detailed schema property descriptions. | true |
schema-hide-read-only |
'default' hides read-only properties in request bodies while displaying them in response models
and webhook callbacks. Set to 'never' to always display read-only fields across all payloads.
Note: This does not affect example generation. See it running → | default |
schema-hide-write-only |
'default' hides write-only properties in response bodies while displaying them in request
payloads. Set to 'never' to always display write-only fields across all payloads. Note: This does not affect example generation. See it running → | default |
default-schema-tab |
Selects which tab is active by default, and listed first, for request bodies, responses and
object parameters: 'schema' (data contract model) or 'example' (sample JSON payload). | example |
Try & Servers Attributes 7
| Attribute | Description and allowed values | Default |
|---|---|---|
allow-try |
Enables the interactive "TRY" console allowing users to test live API calls directly from their
browser. Besides true and false, it takes the terms of filter-operations
to turn Try on only for the operations they select: !deprecated
!tag:pending-implementation keeps it off for deprecated operations and those tagged
pending-implementation. The others keep their request documentation and show a disabled TRY
DISABLED button. The Authentication section stays usable unless it is false. See it running → | true |
show-curl-before-try |
When set to true, generates and displays copyable cURL
commands directly within the endpoint documentation prior to clicking "TRY". See it running → | false |
fill-request-fields-with-example |
Pre-populates interactive request parameter inputs and request body fields using example values
defined in the OpenAPI spec. | true |
allow-server-selection |
Enables the dropdown allowing users to switch between target servers declared in the OpenAPI
spec. | true |
server-url | Custom API server base URL. Overrides the servers array defined in the OpenAPI specification.
Particularly useful when sharing a single spec across development, staging, and production
environments. | (empty) |
default-api-server | Selects which server URL from the spec's servers list should be selected by default. | (empty) |
fetch-credentials |
Configures credentials mode for cross-origin browser Fetch requests as defined in the Fetch Standard, enabling transmission of cookies and Authorization headers
in CORS requests. | (empty) |
Authentication Attributes 8
| Attribute | Description and allowed values | Default |
|---|---|---|
allow-authentication |
Controls the display of interactive authentication controls (HTTP Basic, Bearer Token, API Key,
OAuth2). Disable to hide authentication dialogs when using hardcoded or pre-authenticated API
keys. | true |
persist-auth |
Keeps API keys, bearer tokens and OAuth access tokens in localStorage across page reloads; an
OAuth token is dropped once it expires. Basic credentials and OAuth client secrets are never
stored. | false |
api-key-name | Name of the header or query parameter used when transmitting the API key in interactive console
requests. | (empty) |
api-key-location |
Specifies whether the API key is passed as an HTTP request header or query parameter. | header |
api-key-value | Pre-configured API key value sent during interactive console requests. Can also be set or
overwritten directly in the UI. | (empty) |
oauth-receiver | Relative or absolute path to the OAuth receiver HTML file for handling authorization
redirection callbacks. | oauth-receiver.html |
additional-authorize-params | Custom query parameters appended to the OAuth2 authorization URL query string (e.g. proxy
launch tokens, prompt, audience). Supported Formats:
| (empty) |
additional-token-params | Custom parameters included in the POST request body sent to the OAuth2 token endpoint (e.g.
custom proxy parameters, resource, audience). Supported Formats:
| (empty) |
Mock Server Attributes 4
| Attribute | Description and allowed values | Default |
|---|---|---|
mock-server |
Enables the built-in, zero-dependency in-browser mock server. Transparently intercepts outgoing
network requests (both RapiDoc's Try console and host application fetch/XHR calls) and serves
mock responses based on OpenAPI examples or generated from schemas. | false |
mock-server-status-code | HTTP status code to answer with, or several separated by commas, used in turn per operation
(503, 503, 200: two failures, then a success); a random: prefix picks one at random for each call (random:200, 500), cycle: says in turn
explicitly. Or a JSON map by operation, each with its own codes and prefix ({ "POST /orders": "cycle:503, 200", "*": "200" }). Set it to an empty string to
use the first 2xx response in the spec. | 200 |
mock-server-delay | Simulated network latency in milliseconds before resolving mock responses. Useful for testing
client loading spinners and optimistic UI updates. For a streamed response (OpenAPI 3.2
itemSchema: Server-Sent Events, JSON Lines), the response
starts at once and this is the gap between its items (300 ms when 0). | 0 |
mock-server-log |
Logs one line per answered request (method, path and status code) to the browser console. | false |
MCP Attributes 2
| Attribute | Description and allowed values | Default |
|---|---|---|
mcp |
Enables Model Context Protocol (MCP) server export for AI agents. true renders an Export MCP Server button in
the overview section that downloads a zip with the MCP manifest (manifest.json), a fixed runtime (runtime.js) and a stdio TypeScript server (server.ts). false or an empty value hides
the button. See it running → | false |
mcp-server-name | Custom name for the generated MCP server. Defaults to the API specification title. | (empty) |