Skip to content
v13.0
GitHub

CSS Parts & Variables

The theming attributes cover colors, radius and scale. For anything else, RapiDoc offers two hooks into its Shadow DOM, where ordinary CSS selectors can’t reach:

  • CSS custom properties, set on rapi-doc, change colors, fonts and sizes everywhere they are used.
  • CSS parts, selected with rapi-doc::part(name), style one kind of element directly.

In your page’s CSS, write rapi-doc::part(name):

/* Target the navigation sidebar panel inside RapiDoc */
rapi-doc::part(section-navbar) {
background: linear-gradient(180deg, #090d16 0%, #030712 100%);
border-right: 1px solid rgba(56, 189, 248, 0.15);
box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
}
/* Target the header wrapper inside the navigation bar */
rapi-doc::part(section-navbar-header) {
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
padding: 16px;
}

Navigation Sidebar

Parts for customizing the sidebar navigation panel, filter inputs, and route links.

Part Name (::part)HTML TargetDescription & Usage
::section-navbar<nav>Outer navigation sidebar container.
::section-navbar-header<div>Header wrapper container inside the sidebar encapsulating the nav logo slot and filter search container.
::section-navbar-logo<slot>Slot container for the brand logo or custom header inside the navigation bar.
::btn-navbar<button>Mobile hamburger toggle button to open or collapse the navigation sidebar.
::section-navbar-search<div>Container wrapping the filter search input inside the navigation sidebar.
::textbox-nav-filter<input>Text input element used for real-time search filtering in the sidebar.
::btn-clear-filter<button>Clear button inside the sidebar search input.
::section-navbar-scroll<div>Scrollable inner container holding all tags, endpoints, and markdown headings.
::section-navbar-item<div>Base part applied to every clickable item in the navigation sidebar.
::section-navbar-overview<div>Sidebar item pointing to the API Overview section.
::section-navbar-servers<div>Sidebar item pointing to the API Servers section.
::section-navbar-auth<div>Sidebar item pointing to the Authentication section.
::section-navbar-operations-top<div>Sidebar item pointing to the top of the operations list.
::section-navbar-tag<div>Sidebar item representing an OpenAPI tag heading.
::section-navbar-path<div>Sidebar item representing an individual endpoint operation (e.g., GET /users).
::section-navbar-active-item<div>Added to the sidebar item of the section in view (operation, tag, overview, servers, authentication), and moved as the reader navigates. Style it to highlight the whole active row, e.g. rapi-doc::part(section-navbar-active-item) { background-color: #E2000F; color: #fff; }.

Header & Branding

Parts for the top utility header, logo slot, and dynamic spec loader.

Part Name (::part)HTML TargetDescription & Usage
::section-header<header>Top utility header bar container.
::section-logo<slot>Slot container for the brand logo or icon.
::label-header-title<div>Title text displayed in the header bar.
::textbox-spec-url<input>Input field for entering an OpenAPI specification URL dynamically.
::textbox-header-filter<input>Search filter input in the header bar.

Main Canvas & Overview

Parts for the primary document canvas, spec title, and info anchors.

Part Name (::part)HTML TargetDescription & Usage
::section-main-content<main>The primary scrollable document canvas wrapper.
::no-spec<p>The hint shown when the element has no spec: no spec-url and nothing loading. Fades in after 1.5s, so a spec loaded from script (loadSpec, or a rapi-flow with its URL box) never shows it.
::section-overview<div>Top introductory overview section containing API metadata, description, and contact info.
::section-overview-title<h1>The main API title heading inside the overview section.
::label-overview-version<span>API version badge inside the overview title.
::anchor-overview<a>Contact email, license, and terms of service links in the overview.

Servers & Environments

Parts for server environment controls, selection, and URL variable templates.

Part Name (::part)HTML TargetDescription & Usage
::section-servers<div>Container for server selection and environment controls.
::section-servers-title<h2>Title heading for the API Servers section.
::label-selected-server<div>Label displaying the currently selected base server URL.
::textbox-server-var<input>Input fields for server URL template variables.

Authentication & Security

Parts for authentication credentials, OAuth2 scopes, and security modals.

Part Name (::part)HTML TargetDescription & Usage
::section-auth<div>Container for authentication credentials and security scheme panels.
::section-auth-title<h2>Title heading for the Authentication section.
::auth-list<ul>List of security schemes (replaces the v11 `#auth-table` table).
::auth-scheme<li>One security scheme; also has the class of its type (`apikey`, `http`, `oauth2`, …).
::auth-flows<div>OAuth2 flows inside their security scheme.
::section-auth-scopes<div>Wrapper for OAuth2 authorization scope options.
::checkbox-auth-scope<input type='checkbox'>Checkbox for selecting individual OAuth2 permission scopes.
::textbox-auth-client-id<input>Input field for the OAuth2 client ID.
::textbox-auth-client-secret<input>Input field for the OAuth2 client secret.
::textbox-username<input>Username input field for HTTP Basic or password authentication.
::textbox-password<input>Password input field for HTTP Basic or password authentication.

Operations & Endpoints

Parts for endpoint headers, method badges, paths, summaries, and dividers.

Part Name (::part)HTML TargetDescription & Usage
::section-tag<section>Tag group container grouping multiple related operations.
::section-tag-title<h2>Header title displayed for an OpenAPI tag.
::label-tag-title<h2>Text label for the tag title.
::section-tag-description<div>A tag's description in <rapi-doc-mini> with show-tags="true", indented to line up with the method badges.
::section-operations-in-tag<section>Container wrapping all operations belonging to a tag.
::section-operation<article>Single endpoint operation container.
::section-operation-tag<div>Tag badge/indicator rendered within the operation header.
::section-req-resp-container<div>Container holding both the request configuration and response viewing panels.
::section-request-panel<div>Panel containing request parameters, headers, and payload inputs.
::section-request-title<h4>The Request label heading of an operation (<h6> inside callbacks).
::section-response-title<h4>The Response label heading of an operation (<h6> inside callbacks).
::section-operation-summary<h3>Summary heading for the operation.
::label-operation-method<span>HTTP method label badge (e.g., GET, POST, PUT, DELETE).
::label-operation-path<span>Endpoint URI route path.
::endpoint-badge<span>Status badge on endpoint (e.g., deprecated, webhook).
::operation-divider<div>Horizontal divider separating operations in read mode.
::section-endpoint-head-expanded<div>Header row of an expanded endpoint in view or focused mode.
::section-endpoint-head-collapsed<div>Header row of a collapsed endpoint in view mode.
::section-endpoint-head-method<div>HTTP method badge in the endpoint header row.
::section-endpoint-head-path<div>Path text in the endpoint header row.
::section-endpoint-head-description<div>Short summary description in the endpoint header row.
::section-endpoint-body-expanded<div>Full body container of an expanded endpoint.
::section-endpoint-body-collapsed<div>Body container when an endpoint is collapsed.
::section-endpoint-body-title<h3>Summary title inside the expanded endpoint body.
::section-endpoint-body-description<div>Full markdown description inside the expanded endpoint body.
::section-operation-security<div>Row of authentication chips right under the method and path (above the description); wraps onto more lines when narrow.
::label-operation-security<span>The "Authorization" label of the operation security row. Visually hidden (it names the group for screen readers); a lock icon starts the row instead.
::anchor-operation-security<a>Lock icon at the start of the operation security row; links to the Authentication section. Shown as a plain icon when authentication is not allowed.
::operation-security-chip<span>One authentication chip (e.g. "OAuth (Oauth2) + 1 more"). Hover or keyboard focus opens its details popover; it does not navigate.
::operation-security-details<div popover>Details popover for a chip, shown on hover or keyboard focus and closed with Escape.

Headings

Every heading RapiDoc generates (not headings inside markdown descriptions) carries these parts, so one rule can style a whole level. Outline: API title h1; servers, authentication, tag groups and tags h2; operations h3; Request/Response h4; parameter and request-body labels h5.

Part Name (::part)HTML TargetDescription & Usage
::heading<h1>-<h6>Any heading generated by RapiDoc.
::heading-1<h1>Level 1: the API title.
::heading-2<h2>Level 2: servers, authentication, tag groups, tags, component groups, and the tag label above an operation in focused mode.
::heading-3<h3>Level 3: operation summaries, server variables, OAuth flows, and component names.
::heading-4<h4>Level 4: Request, Response, Code samples, and Callbacks labels.
::heading-5<h5>Level 5: parameter, request body, and response header labels; callback names.
::heading-6<h6>Level 6: Callback request and Callback response labels.

Interactive Console & Buttons

Parts for the Try console, buttons, response panels, and action triggers.

Part Name (::part)HTML TargetDescription & Usage
::wrap-request-btn<div>Container wrapping the Try, Clear, and Execute action buttons.
::btn<button>Base part applied to all buttons across RapiDoc.
::btn-try<button>The primary 'TRY' execution button.
::btn-fill<button>Solid filled buttons (e.g., primary actions, search). Also on FILL EXAMPLE; target btn-fill-example to style that button alone.
::btn-fill-example<button>The FILL EXAMPLE button, which refills request fields with the spec's examples; it is only rendered when a field has an example, and CLEAR is disabled while every field is empty. To hide both: rapi-doc::part(btn-fill-example), rapi-doc::part(btn-clear) { display: none; }
::btn-outline<button>Outlined secondary buttons.
::btn-clear<button>Button to clear request parameter fields.
::btn-clear-response<button>Button to clear returned response data.
::btn-copy<button>Copy-to-clipboard button on code blocks and responses.
::btn-search<button>Search submit button in filter dialogues and headers.
::btn-response-status<button>HTTP response status code selector buttons (e.g., 200, 400, 404).
::btn-selected-response-status<button>The currently active HTTP response status button.

Tabs & Code Panels

Parts for switching between Request/Response tabs, Example/Schema, and languages.

Part Name (::part)HTML TargetDescription & Usage
::tab-panel<div>Container panel wrapping tab controls and content.
::tab-btn-row<div>Row of tab selector buttons.
::tab-btn<button>Individual tab button.
::tab-content<div>Body container of the active tab.

Parameter Lists

Request parameters, request-body form fields, response headers, and server variables. Each list is a grid; every parameter is a subgrid row, so columns line up across rows.

Part Name (::part)HTML TargetDescription & Usage
::param-list<ul>The list; a three-column grid (label, input, constraints). Stacks into one column on narrow widths.
::param<li>One parameter; draws its own full-width border. Has the `deprecated` class when deprecated.
::param-label<div>First column: name and type.
::param-name<div>Parameter name, with the required marker and deprecated icon.
::param-type<div>Parameter type or format.
::param-input<div>Try-it input (only with `allow-try="true"`, plus object form fields and server variables). Spans both right-hand columns when there are no constraints.
::param-constraint<dl>Constraints as label/value pairs (Default, Pattern, Limits, Allowed, or a response header Example). The labels share one column, so all values start at the same place.
::param-constraint-label<dt>A constraint label ("Default:", "Pattern:", "Limits:", "Allowed:").
::param-details<div>Description and examples, under the input and constraints.
::param-example-list<ul>Long-format examples (with a summary or description); one entry per example, each with a thin left rule.
::value-list<div>A label with a wrapping list of values (Allowed values, short-format Examples). Wrapped lines line up under the first value.
::value-list-label<span>The label of a value list ("Allowed:", "Examples:").
::value-list-items<ul>The values; separators between them are drawn in CSS and stay at the end of a line.

Inputs & Form Fields

Parts for parameter inputs, textareas, file pickers, and checkboxes.

Part Name (::part)HTML TargetDescription & Usage
::textbox<input>Standard text input field.
::textbox-param<input>Input field for query, path, and header parameters.
::textarea<textarea>Standard multi-line text input field.
::textarea-param<textarea>Multi-line text input for request bodies and payload parameters.
::file-input<input type='file'>File upload input element for multipart forms.
::checkbox<input type='checkbox'>Standard checkbox input.
::anchor<a>General links throughout the documentation.
::anchor-param-example<button>Example value chip; clicking it fills the parameter input.
::anchor-param-constraint<button>Allowed (enum) value chip; clicking it fills the parameter input.

Schema & Data Types

Parts for schema descriptions, tree toolbars, and badges.

Part Name (::part)HTML TargetDescription & Usage
::schema-description<span>Markdown description text inside schema definitions.
::schema-toolbar-item<div>Controls on schema cards (expand, collapse, view options).
::schema-multiline-toggle<div>Toggle button to expand or collapse multi-line descriptions.

Set variables on rapi-doc in your stylesheet or inline style:

rapi-doc {
/* Override surface tokens */
--background: #0b1121;
--foreground: #f8fafc;
--card: #0f172a;
--border: #1e293b;
/* Override typography tokens */
--font-sans: 'Inter', sans-serif;
--font-mono: 'JetBrains Mono', monospace;
/* Override radius token */
--radius: 8px;
}

All variables, with their defaults:

Surface Colors (shadcn/ui)

shadcn/ui color tokens. Set them on rapi-doc, or use `inherit` to take a shadcn/ui page's :root values.

CSS Custom PropertyDefault / Calculated ValueDescription
--backgroundoklch(0.2613 0.0134 272.84) (dark) / #ffffff (light)Page background of the component.
--foreground#cccccc (dark) / #444444 (light)Default text color, including markdown descriptions.
--cardmix of --background and --foregroundElevated surfaces: dialogs, table headers, tooltips.
--card-foregroundderived from --foregroundText on elevated surfaces.
--mutedmix of --background and --foregroundSubtle surfaces: inline code, tags, secondary buttons, scrollbar thumbs.
--muted-foregroundderived from --foregroundSecondary text: parameter descriptions, constraints, inactive tabs.
--bordermix of --background and --foregroundDividers and outlines of tables, cards, panels.
--inputslightly stronger than --borderBorder color of form fields (shadcn/ui meaning).
--destructive#ef4444 (dark) / #dc2626 (light)Errors, required-field markers, and DEPRECATED labels.

Brand & Focus (shadcn/ui)

Accent colors. The theme attribute (preset name or hex color) sets --primary, --primary-foreground, and the accent as readable text for each color scheme.

CSS Custom PropertyDefault / Calculated ValueDescription
--primarytheme preset (#f76b39 for amber)Brand accent: buttons, links in navigation, active states.
--primary-foregroundtheme preset (#000000 for amber)Text on --primary backgrounds.
--primary-textvar(--primary-text-dark) or var(--primary-text-light), by color schemeThe accent as text: links, and allowed values and examples that fill an input. Readable (4.5:1) on the background, cards and accent tints.
--primary-text-darkcomputed from the theme (#f76b39 for amber)--primary-text in the dark color scheme: --primary lightened until it is readable.
--primary-text-lightcomputed from the theme (#b24d29 for amber)--primary-text in the light color scheme: --primary darkened until it is readable.
--ringvar(--primary)Focus ring color.
--focus-shadow0 0 0 1px transparent, 0 0 0 2px color-mix(in srgb, var(--ring) 40%, transparent)Box shadow used for keyboard focus.
--selection-bgcolor-mix(in srgb, var(--primary) 25%, transparent)Background of selected text.
--selection-fgvar(--foreground)Color of selected text.

Navigation Sidebar (shadcn/ui)

shadcn/ui sidebar tokens for the navigation bar, plus its sizing.

CSS Custom PropertyDefault / Calculated ValueDescription
--sidebarvar(--background)Navigation bar background.
--sidebar-foregroundvar(--foreground)Navigation item text.
--sidebar-primaryvar(--primary)Active item text and its left marker.
--sidebar-accentslightly darker/lighter than --backgroundHovered item background.
--sidebar-accent-foregroundvar(--foreground)Hovered item text.
--sidebar-bordervar(--border)Border between the navigation bar and the content.
--sidebar-ringvar(--ring)Focus color of the navigation filter input.
--sidebar-width18.75rem (default) / 17rem (scale=sm) / 21rem (scale=lg)Width of the navigation bar.
--sidebar-item-padding0.4375rem 1rem 0.4375rem 0.625rem (nav-item-spacing sets compact/relaxed)Padding of navigation items.
--sidebar-logo-max-height60pxMaximum height of the nav-logo slot.

Typography

Font families, sizes, and the heading scale shared by RapiDoc headings and markdown descriptions.

CSS Custom PropertyDefault / Calculated ValueDescription
--font-sans-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serifFont for text, headings, and navigation (shadcn/ui token).
--font-monoui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Roboto Mono', monospaceFont for code, HTTP methods, paths, and schemas (shadcn/ui token).
--font-size-xs11px (default) / 11px (scale=sm) / 12px (scale=lg)Smallest text and the size floor: badges, method tags in the sidebar, oneOf/anyOf chips, constraint labels, tiny buttons.
--font-size-small12px (default) / 11px (scale=sm) / 14px (scale=lg)Small text: parameter names and types, schema trees, tabs, labels.
--font-size-description13px (default) / 12px (scale=sm) / 15px (scale=lg)Short prose next to data: parameter, property, and response-header descriptions.
--font-size-mono13px (default) / 12px (scale=sm) / 15px (scale=lg)Code blocks and monospace text.
--font-size-regular14px (default) / 13px (scale=sm) / 16px (scale=lg)Body text and descriptions.
--line-height1.6Line height of paragraphs and list items in descriptions.
--paragraph-spacing1emSpace between consecutive paragraphs in descriptions.
--heading-fontvar(--font-sans)Font of headings.
--heading-weight600Font weight of headings.
--heading-line-height1.25Line height of headings.
--heading-letter-spacingnormalLetter spacing of headings.
--heading-colorvar(--foreground)Text color of headings.
--heading-margin-top1.5emSpace above a heading (0 for the first element in a section).
--heading-margin-bottom0.5emSpace below a heading.
--h1-font-size2remh1: the API title.
--h2-font-size1.5remh2: tags and top-level sections.
--h3-font-size1.25remh3: operation summaries.
--h4-font-size1remh4.
--h5-font-size0.875remh5.
--h6-font-size0.8125remh6.
--label-heading-font-sizevar(--font-size-small)Small upper-case label headings (Path parameters, Request body, ...).

Layout & Geometry

Corner radius and sizing.

CSS Custom PropertyDefault / Calculated ValueDescription
--radius0.25rem (radius attribute: none, sm, md, lg, full)Corner radius of buttons, inputs, badges; cards and dialogs use min(var(--radius), 0.5rem) (shadcn/ui token).
--resp-area-height400pxMaximum height of response and multi-line text areas.
--table-schema-key-width240pxWidth of the property-name column in table schema style.
--table-schema-key-text-overflowellipsistext-overflow of long property names in table schema style.
--table-schema-key-whitespacenowrapwhite-space of property names in table schema style.
--param-label-width12remWidth of the label column (name and type) in parameter lists.
--param-gap0.5remSpace between the columns of a parameter list.
--param-row-gap0.25remSpace between the rows inside one parameter (input or constraints, then details).
--param-padding0.5remPadding inside each parameter of a parameter list.
--value-list-gap0.375remSpace on each side of the separator between values (Allowed values, Examples).
--value-list-row-gap0.125remSpace between wrapped lines of a value list.
--value-list-label-gap0.25remSpace between a value list label and its first value.
--auth-scheme-padding0.75remPadding inside each security scheme; OAuth flows are indented four times this.
--scroll-margin-top120pxSpace kept above a section when navigation scrolls to it; set it to your sticky header height.

HTTP Methods

Colors of method badges, operation borders, and navigation method labels.

CSS Custom PropertyDefault / Calculated ValueDescription
--method-get#5c98f9 (dark) / #2563eb (light)GET.
--method-post#68cc97 (dark) / #047857 (light)POST.
--method-put#f59e0b (dark) / #c2410c (light)PUT.
--method-delete#f75252 (dark) / #b91c1c (light)DELETE.
--method-patch#a78bfa (dark) / #7c3aed (light)PATCH.
--method-head#eab308 (dark) / #b45309 (light)HEAD.
--method-options#06b6d4 (dark) / #0e7490 (light)OPTIONS.
--method-trace#ec4899 (dark) / #be185d (light)TRACE.
--method-query#818cf8 (dark) / #4f46e5 (light)QUERY.
--method-default#64748b (dark) / #475569 (light)Any other method (COPY, PURGE, ...).
--method-badge-fg#000000 (dark) / #ffffff (light)Text on filled method badges in the navigation.

Named Colors

Palette referenced by name from x-badges (color: blue, green, ...) and used for links and status text.

CSS Custom PropertyDefault / Calculated ValueDescription
--blue#3b82f6 (dark) / #2768f4 (light)Blue; also link color.
--green#10b981 (dark) / #059669 (light)Green.
--orange#f59e0b (dark) / #d97706 (light)Orange.
--red#ef4444 (dark) / #dc2626 (light)Red (badges only; errors use --destructive).
--purple#8b5cf6 (dark) / #7c3aed (light)Purple.
--yellow#eab308 (dark) / #b45309 (light)Yellow.
--pink#ec4899 (dark) / #db2777 (light)Pink.
--brown#d97706 (dark) / #92400e (light)Brown.

Code & Syntax Highlighting

Code block background and syntax token colors.

CSS Custom PropertyDefault / Calculated ValueDescription
--code-bgvar(--input-background) (dark) / --background with 4% --foreground (light)Background of code blocks and examples.
--input-backgroundslightly darker than --background (dark) / var(--background) (light)Background of form fields.
--syntax-comment#8b949e (dark) / #6e7781 (light)Comments.
--syntax-keyword#ff7b72 (dark) / #cf222e (light)Keywords.
--syntax-operator#c9d1d9 (dark) / #24292f (light)Operators and punctuation.
--syntax-string#a5d6ff (dark) / #0a3069 (light)String literals.
--syntax-constant#79c0ff (dark) / #0550ae (light)Numbers, booleans, constants.
--syntax-function#d2a8ff (dark) / #8250df (light)Function names.
--syntax-type#d2a8ff (dark) / #8250df (light)Type names.
--syntax-variable#ffa657 (dark) / #953800 (light)Variables.
--syntax-property#79c0ff (dark) / #0550ae (light)Object keys and properties.
--syntax-tag#7ee787 (dark) / #116329 (light)Markup tags.
--syntax-selector#d2a8ff (dark) / #8250df (light)CSS selectors.
--syntax-inserted#7ee787 (dark) / #116329 (light)Inserted lines in diffs.
--syntax-deleted#ff7b72 (dark) / #cf222e (light)Deleted lines in diffs.

/* Frosted glass backdrop blur on sidebar */
rapi-doc::part(section-navbar) {
background: rgba(10, 15, 26, 0.85);
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
border-right: 1px solid rgba(255, 255, 255, 0.08);
}
/* Sidebar header area (wrapping logo & search) */
rapi-doc::part(section-navbar-header) {
padding: 16px;
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
/* Real-time search filter input inside sidebar */
rapi-doc::part(textbox-nav-filter) {
background: rgba(15, 23, 42, 0.6);
border: 1px solid rgba(56, 189, 248, 0.2);
border-radius: var(--radius);
color: #f8fafc;
padding: 8px 12px;
}
rapi-doc::part(textbox-nav-filter):focus {
border-color: #06b6d4;
box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}
/* Base button enhancements */
rapi-doc::part(btn) {
border-radius: var(--radius);
font-weight: 600;
transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
/* Primary filled buttons, such as TRY */
rapi-doc::part(btn-fill) {
background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
color: #ffffff;
border: none;
padding: 8px 16px;
box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25);
}
rapi-doc::part(btn-fill):hover {
transform: translateY(-1px);
box-shadow: 0 6px 16px rgba(6, 182, 212, 0.4);
}
/* Server selector container */
rapi-doc::part(section-servers) {
background: rgba(15, 23, 42, 0.7);
border: 1px solid rgba(56, 189, 248, 0.2);
border-radius: var(--radius);
padding: 16px 20px;
}
/* Selected base URL indicator */
rapi-doc::part(label-selected-server) {
color: #38bdf8;
font-family: var(--font-mono);
font-weight: 600;
}

In both Tree mode and Table mode, each schema row shows its description on a single line. Click a description (or its ➔ arrow) to expand that row, and click again to collapse it. The Multiline description toolbar button expands every row at once.

In Tree mode, property names, data types, constraints, and descriptions are displayed in a continuous, hierarchically indented horizontal line:

RapiDoc Schema Tree Mode Structure
  • Field Column: Has a dynamic minimum column width (min-width: calc(400px - indent)).
  • Long Property Names: Truncated with an ellipsis, with the full name in a hover tooltip (title="..."). Expanding the row also shows the full name.
Description content Collapsed row ➔ arrow
One paragraph that fits The whole paragraph No
One paragraph that is too long for the column The start of the paragraph, cut off with an ellipsis Chrome and Edge (see below)
Several paragraphs, a list with several items, or a <br> line break The first paragraph or list item Yes
A table, code block, HTML block or blockquote first A one-line summary: Table · 3 rows, Code block · json, the text of the HTML, or the quote’s first line Yes
A heading first The heading text, at description size Yes, when more follows
A schema title before a list, heading, table or code block Title: and the first line of that block Yes
A description plus constraints, default, allowed values or pattern The description; the constraint chips are hidden Yes
Constraints only, no description The constraint chips No
Nothing An empty cell No

Whether a line is too long is decided by the browser at the actual column width and font, not by counting characters, so it adapts to split panes, sidebars and resizing without any JavaScript.

A cut-off line always ends with a plain ellipsis in the text color. The ➔ arrow is the only control.

  • Chrome and Edge (133+): a row whose line is cut off also shows the ➔ arrow and a pointer cursor. This uses a CSS scroll-state container query.
  • Other browsers: the ellipsis is the only cue. Clicking the text still expands the row.

An expanded row keeps its arrow, pointing up, so it can be collapsed again. A row with nothing more to show (a line that fits, and no arrow) doesn’t react to clicks.

rapi-doc {
/* Allocate more width for property names in Table mode */
--table-schema-key-width: 300px;
}

Request parameters, request-body form fields, response headers, and server variables share one layout: a <ul part="param-list"> grid with one <li part="param"> per parameter. Each parameter is a subgrid row with up to four pieces:

Part Column Content
param-label 1 param-name (required marker, deprecated icon) and param-type
param-input 2 Try-it input; spans columns 2–3 when there are no constraints
param-constraint 3 Default, pattern, range, allowed values; spans columns 2–3 when there is no input
param-details 2–3 Description and examples, on the next row

Allowed values and short-format examples are a value-list: a value-list-label followed by value-list-items. Wrapped values line up under the first value, and the ┃ separators are drawn in CSS so they stay at the end of a line. Space them with --value-list-gap, --value-list-row-gap, and --value-list-label-gap.

Below about 36rem of available width the list stacks into a single column. Size it with --param-label-width, --param-gap, --param-row-gap, and --param-padding:

rapi-doc {
--param-label-width: 14rem;
--param-padding: 0.75rem;
}
rapi-doc::part(param-name) {
font-weight: 600;
}
rapi-doc::part(param-details) {
color: var(--muted-foreground);
}