Exciting news!Announcing our $4.6M Series Seed. Learn more
Socket
LoveBlogFAQ
Install
Log in

@open-rpc/docs-react

Package Overview
Dependencies
16
Maintainers
2
Versions
26
Issues
File Explorer

Advanced tools

@open-rpc/docs-react

OpenRPC documentation as a react component

    1.5.0latest

Version published
Maintainers
2
Yearly downloads
12,875
increased by35.8%

Weekly downloads

Readme

Source

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

Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc