@open-rpc/docs-react
TypeScript icon, indicating that this package has built-in type declarations

2.1.1 • Public • Published

docs-react

OpenRPC documentation as a react component

What is this?

This is a react component that will render documentation for a given OpenRPC document.

Screenshot:

image

How do I use this?

Installation:
npm install --save @open-rpc/docs-react
Usage:
import Documentation from "@open-rpc/docs-react";

and then use it somewhere:

<Documentation schema={schema} />
Example in a new project:
create a new typescript project with create-react-app
npx create-react-app <appname> --typescript
cd <appname>
npm install .
npm install @open-rpc/docs-react @open-rpc/meta-schema --save
index.ts
import React from 'react';
import ReactDOM from 'react-dom';
import Documentation from "@open-rpc/docs-react";
import { OpenrpcDocument } from '@open-rpc/meta-schema';

const schema: OpenrpcDocument = {
  openrpc: "1.2.4",
  info: {
    "version": "0.0.0-development",
    "title": "My New API"
  },
  methods: []
};

ReactDOM.render(<Documentation schema={schema} />, document.getElementById("root"));

screenshot

image

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.1.112latest

Version History

VersionDownloads (Last 7 Days)Published
2.1.112
2.1.00
2.0.00
1.5.0150
1.4.10
1.4.00
1.3.00
1.2.63
1.2.50
1.2.40
1.2.30
1.2.20
1.2.11
1.2.01
1.1.50
1.1.40
1.1.31
1.1.20
1.1.11
1.1.02
1.0.100
1.0.90
1.0.80
1.0.71
1.0.61
1.0.50
1.0.40
1.0.31
0.0.0-development1

Package Sidebar

Install

npm i @open-rpc/docs-react

Weekly Downloads

175

Version

2.1.1

License

Apache-2.0

Unpacked Size

2.97 MB

Total Files

97

Last publish

Collaborators

  • belfordz
  • shanejonas