Back to components
API component

Scalar API Docs

Beautiful, interactive API docs deployed in 30 seconds.

Install

$ Run in your project root
pnpm dlx shadcn@latest add https://ui-components.desishub.com/r/scalar-api-docs.json

What it does

  • 3 REST endpoints (Products, Categories, Users) with GET all + GET by ID
  • Full OpenAPI 3.0.3 spec with schemas, examples, descriptions
  • Scalar API Reference UI deployed at /api-docs
  • Dummy data for immediate testing
  • Auto-installs @scalar/nextjs-api-reference and openapi-types

When to use

Use it

API prototyping, frontend dev with working endpoints, learning REST, hackathons, client demos.

Skip it

Custom auth schemes or non-REST APIs (GraphQL, tRPC).

Prerequisites

  • Initialized Next.js project

Files & routes added

  • app/api-docs/route.ts (Scalar UI)
  • app/api/openapi/route.ts (OpenAPI JSON)
  • app/api/products/, /categories/, /users/ — list + detail
  • data/openapi.ts, data/dummy.ts