API playgroundPro
Pick an endpoint, edit headers and body, send, and read the JSON response or cURL.
pnpm dlx shadcn@latest add @lode/api-playgroundWhat's inside
- Endpoint list
- Headers and body editor
- JSON response with status and timing
- cURL snippet
When to use
- API reference and developer portals.
When not to use
- Production consoles that change data without confirmation.
Installation
pnpm dlx shadcn@latest add @lode/api-playgroundLands in components/blocks/api-playground.tsx with sample data you replace with your own. Pro installs use an API key: see CLI and API keys.
The CLI also installs motion, lucide-react and every Lode component it's built from.
Usage
Import it from @/components/blocks/api-playground after installing. It ships with sample data, so it renders straight away; swap in your own data when you're ready.
import { ApiPlayground } from "@/components/blocks/api-playground";
export default function Page() {
return (
<main className="mx-auto max-w-6xl p-6">
<ApiPlayground />
</main>
);
}API reference
ApiPlayground
Pick an endpoint, edit headers and body, send, and read the response with status, timing and a cURL snippet. Also the default export. No props: sample data sits at the top of the file, ready to swap for your own.
No props.
Keyboard interactions
| Keys | Action |
|---|---|
| Tab | Move through endpoint, params and Send |
| ←or→ | Switch request tabs |
Accessibility
- Every field is labelled; the response is announced when it arrives.
Motion
- The response panel fades in with its status.
Responsive behavior
- Request and response stack below 1024px.
Performance
- Responses are simulated locally; nothing is sent.
Notes for AI
- Replace the simulated fetch with a proxy route so keys stay on the server.
This page as Markdown, for assistants and coding agents:
/blocks/api-playground/markdownThe full library index for assistants is at /llms.txt.
Related
Lode·229 doc pages·llms.txt