Staaarter

API Endpoint Explorer

An interactive REST API reference grouped by resource. Each endpoint row shows its HTTP method and path, and expands in place to reveal a parameter table (name, type, required, description) and a response-type summary. Built for developer-facing API documentation pages.

By Staaarter Team
DevTools
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its badge dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/api-endpoint-explorer.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/devtools/devtools19.tsx instead.

Usage

The file also exports devtools19Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Devtools19, devtools19Demo } from "@/components/blocks/devtools/devtools19";

export default function Page() {
  return <Devtools19 {...devtools19Demo} />;
}

Props

PropTypeDefaultDescription
headingstring"API Reference"Section heading.
descriptionstringundefinedSection intro text below the heading.
groupsEndpointGroup[]noneResource groups, each with its own heading and endpoint list.
classNamestringnoneExtra classes for the outer section element.

Types

type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";

type EndpointParam = {
  name: string;
  type: string;
  required: boolean;
  description: string;
};

type ApiEndpoint = {
  id: string;
  method: HttpMethod;
  path: string;
  summary: string;
  params: EndpointParam[];
  responseType: string;
};

type EndpointGroup = { resource: string; endpoints: ApiEndpoint[] };

Behavior notes

  • Endpoint expand/collapse is real local state (a Set of expanded endpoint ids); no request is ever actually sent, this only reveals the static params and responseType already supplied for that endpoint.
  • Method badge colors are a fixed convention (GET=sky, POST=emerald, PUT/PATCH=amber, DELETE=red) applied by the method string, not independently configurable per endpoint.
  • There is no "Try it" request runner; params and responseType are documentation text, not a live request builder.
  • Groups render in the order given with no collapsing at the group level, only at the individual endpoint level.