terra vidhal

Api Request Builder

Component

About

An API request playground with method and URL controls, editable parameter and header rows, a JSON body, a live URL preview, a simulated response with timing and copy plus empty 204 handling, and a clickable history that restores parameters.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Api Request Builder to your project and fits it to your theme.

Code

How Api Request Builder is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

/**
 * PrequelUI Animate — MIT — https://prequeluianimate.terravidhal.me
 */

import {
  ApiRequestBuilder,
  type RequestHistoryEntry,
} from "@/components/ui/api-request-builder";

const HISTORY: RequestHistoryEntry[] = [
  { id: "h1", method: "GET", url: "https://api.fieldnotes.test/v2/projects?limit=20", status: 200, duration: 184 },
  { id: "h2", method: "POST", url: "https://api.fieldnotes.test/v2/projects", status: 201, duration: 246 },
  { id: "h3", method: "DELETE", url: "https://api.fieldnotes.test/v2/projects/prj_5521", status: 204, duration: 131 },
];

export default function ApiRequestBuilderDemo() {
  return (
    <main className="flex min-h-screen w-full items-start justify-center bg-gradient-to-b from-muted/40 via-background to-background px-4 py-8 sm:px-6">
      <ApiRequestBuilder
        defaultUrl="https://api.fieldnotes.test/v2/projects"
        initialHistory={HISTORY}
        title="Projects API playground"
      />
    </main>
  );
}

Dependencies

More by terra vidhal

View all
  • Project Timeline

    Project Timeline

    29
  • Gravity Stars Background

    Gravity Stars Background

    20
  • Kanban Board

    Kanban Board

    19
  • Booking Calendar

    Booking Calendar

    18
  • Notification Center

    Notification Center

    16
  • Audio Waveform

    Audio Waveform

    16
  • Kpi Counter

    Kpi Counter

    16
  • Topographic Lines

    Topographic Lines

    16

Explore more

Part of PrequelUI Animate — browse the full library on 21st.dev.