@overtrue/pivot
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Pivot

A modern React component library for visualizing and interacting with OpenAPI specifications.

Features

  • 🚀 Full support for OpenAPI 3.x specifications
  • 🎨 Beautiful and responsive UI components
  • ⚡️ Interactive "Try it out" functionality
  • 📦 Lightweight and tree-shakable

Installation

npm install @overtrue/pivot
# or
yarn add @overtrue/pivot

Basic Usage

import { OpenApiLayout } from '@overtrue/pivot';
import spec from './openapi-spec.json';

function App() {
  return <OpenApiLayout spec={spec} />;
}

Components

OpenApiLayout

The main layout component that renders the complete OpenAPI documentation.

TryItOutPanel

Standalone component for making API requests:

import { TryItOutPanel } from '@overtrue/pivot';

function TestPage() {
  return (
    <TryItOutPanel
      operation={operationObject}
      method="post"
      path="/api/users"
    />
  );
}

Development

# Install dependencies
npm install

# Build the library
npm run build

License

MIT

Package Sidebar

Install

npm i @overtrue/pivot

Weekly Downloads

22

Version

1.0.2

License

MIT

Unpacked Size

2.26 MB

Total Files

108

Last publish

Collaborators

  • anzhengchao