API Reference Table

Expandable prop reference table with color-coded types, optional descriptions, and full-type details. Designed for component documentation pages.

lucide-react

Preview

GitHubStarsButton

PropType

Installation

$ shadcn add https://ui.justinlevine.me/r/api-ref-table.json

Usage

import { ApiRefTable } from "@/components/api-ref-table"
<ApiRefTable title="MyComponent" props={[{ name: "size", type: '"sm" | "lg"' }]} />

Examples

Prop types

Required Props

Props

PropType

Mixed Types

Props

PropType

Union types

String Union

Props

PropType

Full Type Expansion

Props

PropType

API Reference

ApiRefTable

PropType

Notes

  • Client component. Uses "use client" for the expandable row interaction.
  • Color-coded types. Types are automatically colored — string (sky), number (amber), boolean (purple), function (rose), ReactNode (teal), and custom types (emerald).
  • Expandable rows. Rows with a description or fullType expand on click to reveal details.