/reviewsRequest body
diffstringRequired
Displays an endpoint’s method, path, parameters and nested request and response schemas.
/reviewsdiffstringRequired/projects/{projectId}/reviewsprojectIdstringpathRequiredProject to review.
diffstringRequiredoptionsobjectincludeTestsbooleanInclude test files in the review.
idstringRequiredfindingsarrayfindingobjectfilestringRequiredlinenumbersummarystringnpm install @noorddev/vlak-react
Load the stylesheet once at your app root, then import the components you use.
import "@noorddev/vlak-react/css";
import { SchemaDisplay } from "@noorddev/vlak-react";Per-component imports are available at @noorddev/vlak-react/components/schema-display.
npx @noorddev/vlak-cli add schema-display
Adds the component and its dependencies to components/vlak/. Follow the StyleX setup to compile the source in your application.
npx shadcn add https://vlak.dev/r/schema-display.json
Installs the same source through the shadcn CLI.
import { SchemaDisplay } from "@noorddev/vlak-react";
<SchemaDisplay method="POST" path="/projects/{projectId}/reviews" parameters={[{ name: "projectId", type: "string", required: true, location: "path" }]} requestBody={[{ name: "diff", type: "string", required: true }]} responseBody={[{ name: "id", type: "string", required: true }]} />See the integration example to compose these components with your application's model and data.
Endpoint documentation with bounded, expandable object and array schemas.
| Prop | Type | Default | Description |
|---|---|---|---|
methodrequired | "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS" | ||
pathrequired | string | ||
description | ReactNode | ||
parameters | SchemaParameter[] | ||
requestBody | SchemaProperty[] | ||
responseBody | SchemaProperty[] | ||
maxDepth | number | 6 | Bounds recursive schema rendering. Defaults to 6 levels and 200 properties. |
maxNodes | number | 200 |
Also accepts HTMLAttributes<HTMLElement>.
The ref reaches HTMLElement.
| Keys | Does |
|---|---|
| Tab | Tab reaches each native schema summary. |
| Enter, Space | Enter or Space toggles parameters, bodies and nested properties. |
The same styles are available as CSS. Native HTML provides the static presentation; React or application code supplies state updates and actions.
npm install @noorddev/vlak
import "@noorddev/vlak/css";
<article class="rs-schema-display" aria-label="POST /reviews"><header class="rs-schema-display-header"><span class="rs-badge-muted">POST</span><code class="rs-schema-display-path">/reviews</code></header><div class="rs-schema-display-content"><details class="rs-disclosure" open><summary class="rs-disclosure-summary">Request body</summary><ul class="rs-schema-display-list"><li class="rs-schema-display-property"><div class="rs-schema-display-line"><code>diff</code><span class="rs-badge-muted">string</span><strong class="rs-schema-display-note">Required</strong></div></li></ul></details></div></article>