shadcn.io is not affiliated with official shadcn/ui
API Endpoints Features Block for React
An endpoint reference for an e-signature API: six rows with a method, a path, a sentence and a status, each opening to a request and a response snippet.
Installation
Overview
An endpoint reference for React with Base UI. A compact header says "Every endpoint, one row" and links to the full API reference. Below, six endpoints run from rail to rail in a band, each ruled by a hairline with a + on both rails: a method badge, the path in monospace, a sentence and the status it answers with. Open a row, and the first one starts open, and a request and a response snippet sit side by side (stacked on a phone). The snippets are plain monospace in your theme's colours, not a window. It's built from Collapsible, Badge, Button and Guides, with CSS transitions for the entrance and the chevron. For API products and developer platforms that want a scannable reference on the marketing page.
FAQ
How do I add or change an endpoint?
Edit ENDPOINTS at the top of the file: each entry has a method, a path, a summary, the status it answers with, and the request and response as one string per line. An empty response shows "(no body)", as the delete row does. Set startsOpen on any row you want open at load.
Can several rows be open at once?
Yes. Each row is its own Collapsible, so opening one never closes another. Every row's header is a button inside a heading, so Tab moves from row to row and Enter or Space opens it; there is no arrow-key navigation between rows.
Can people copy and scroll the snippets?
The snippets are real text in a pre, so they select and copy normally. A line wider than the box scrolls sideways, and the snippet takes keyboard focus so it can be scrolled without a mouse; on a phone the request and response stack, each scrolling on its own.
How are the methods told apart without colour?
By weight and outline: GET is muted, POST is bold, DELETE has a stronger border. The status code is a number in monospace, and screen readers hear it as "Responds 201 Created". The block uses no green or red, so it looks the same in every theme.
Related
- Pro
Alternating Code Block Rows Features
Alternating rowsThree alternating bands for a typed event-stream client, each pairing a sentence with a code window that draws a different artifact: a call with its autocomplete popover, a config file with one line marked, and a command's output.
- Pro
Live Code Playground Showcase Features
App screensA code window in a framed figure with three language tabs, a copy button, and a Run button that shows a spinner and then a typed response panel, for a typed SDK.
- Pro
Terminal Command Showcase Features
App screensA features section for a command-line tool: four tabs (Deploy, Build, Test, Log) swap a dark terminal session typed out once, with commands, output and exit status, above three cells with overshoot that each carry a small chip.
- Pro
Added Removed Diff List Features
App screensA unified diff of one config file in a hairline frame, with + and - gutters in foreground weights, one caption beside each hunk, folded runs of unchanged lines that open in place, and a footer counting the changes.
- Pro
Accordion FAQ Features
Tabs and accordionsA features section for an API gateway told as six capability questions in an accordion beside a sticky side header, each answer a sentence and a small drawing of the capability at work.
- Pro
Split API Playground Hero
Code and terminalA showcase hero for a payments API: a headline, a Shine Button, a second action and three ticks, then a wide playground under its own rule: a POST request beside the 200 response, each JSON body writing itself out.