Skip to content

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.

Spec & Content Attributes 6

AttributeDescription and allowed valuesDefault
spec-url
URL of the OpenAPI specification file (JSON or YAML) to load and render.
(empty)
sort-tags

truefalse

Sorts tags in alphabetical order. When set to "false", preserves the tag order defined in the OpenAPI specification.
false
sort-schemas

truefalse

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

pathmethodsummarynone

Sorts endpoints within each tag group by path, HTTP method, or summary. 'none' leaves the sort order unmodified.
ⓘ This is a static initialization attribute. It will not have any effect if modified using JavaScript after the spec is rendered.
See it running →
path
show-unused-tags

truefalse

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

AttributeDescription and allowed valuesDefault
render-style

readviewfocused

Controls the overall documentation presentation layout. Three distinct modes are supported:
  • view: Optimized for interactive exploration with collapsible operations | Example
  • read: Continuous narrative page layout, ideal for reading through API specifications from top to bottom | Example
  • focused: Displays a single endpoint at a time with a dedicated sidebar, ideal for large enterprise schemas | Example
read
layout

rowcolumn

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

AttributeDescription and allowed valuesDefault
theme

embercarboncobaltjadeindigoamber(or custom hex color e.g. #2563eb)

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

darklightsystemauto

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

nonesmmdlgfull

Corner radius scale applied across cards, buttons, badges, inputs, and dialogs.
sm
scale

smdefaultlg

Relative scale factor for typography and UI elements across the documentation portal.
default
AttributeDescription and allowed valuesDefault
show-side-nav

truefalsefloating

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

falseas-plain-textas-colored-textas-colored-block

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

dotfalse

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

truefalse

Displays raw API URL paths in the navigation bar instead of operation summaries.
NOTE: Setting this to true displays the path only. To display the HTTP method alongside the path, also configure show-method-in-nav-bar.
See it running →
false
info-description-headings-in-navbar

truefalse

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

truefalse

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

AttributeDescription and allowed valuesDefault
show-header

truefalse

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

truefalse

Toggles visibility of the OpenAPI document info section (title, description, version, terms of service). Useful when embedding `` into an existing developer portal or knowledge base that already contains its own header.
true
show-components

truefalse

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-spec-url-load

truefalse

When set to false, disables the input field allowing users to load arbitrary external OpenAPI specification URLs.
true
allow-spec-file-load

truefalse

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

truefalse

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

AttributeDescription and allowed valuesDefault
schema-style

treetable

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

truefalse

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

truefalse

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

defaultnever

'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

defaultnever

'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

schemaexample

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

AttributeDescription and allowed valuesDefault
allow-try

truefalse(or filter-operations terms, e.g. !deprecated)

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

truefalse

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

truefalse

Pre-populates interactive request parameter inputs and request body fields using example values defined in the OpenAPI spec.
true
allow-server-selection

truefalse

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

omitsame-origininclude

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

AttributeDescription and allowed valuesDefault
allow-authentication

truefalse

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

truefalse

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

headerquery

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:
  • JSON String (recommended for HTML attributes):
    additional-authorize-params='{"launch": "xyz123", "prompt": "consent"}'
  • URL Query String:
    additional-authorize-params="launch=xyz123&prompt=consent"
  • JavaScript Object (via property):
    rapidocEl.additionalAuthorizeParams = { launch: 'xyz123', prompt: 'consent' };
(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:
  • JSON String (recommended for HTML attributes):
    additional-token-params='{"audience": "https://api.example.com", "resource": "urn:my:api"}'
  • URL-Encoded String:
    additional-token-params="audience=https%3A%2F%2Fapi.example.com"
  • JavaScript Object (via property):
    rapidocEl.additionalTokenParams = { audience: 'https://api.example.com' };
(empty)

Mock Server Attributes 4

AttributeDescription and allowed valuesDefault
mock-server

truefalse

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

truefalse

Logs one line per answered request (method, path and status code) to the browser console.
false

MCP Attributes 2

AttributeDescription and allowed valuesDefault
mcp

truefalse

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)