JSPM

@onvo-ai/react

0.19.9
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 54
  • Score
    100M100P100Q66223F
  • License MIT

The react SDK for Onvo AI dashboard builder

Package Exports

  • @onvo-ai/react
  • @onvo-ai/react/dist/cjs/index.js
  • @onvo-ai/react/dist/esm/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@onvo-ai/react) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Onvo AI react library

This react package can be used to display the list of dashboards available to a user or single dashboard from Onvo AI. The components are also completely customizable.

Installation

You can install this UI library using npm or yarn:

npm install @onvo-ai/react
yarn add @onvo-ai/react

Usage

To use this UI library in your project, import the components you need from the library and use them in your React apps.

import { Wrapper, DashboardList } from "@onvo-ai/react";
const baseUrl = "https://dashboard.onvo.ai";

const ListPage = () => {
  const [accessToken, setAccessToken] = useState("");
  const userId = "123456";

  useEffect(() => {
    fetch("/api/get-token/" + userId)
      .then((data) => data.json())
      .then((data) => {
        setAccessToken(data.token);
      });
  }, []);

  return (
    <Wrapper baseUrl={baseUrl} token={accessToken}>
      <DashboardList />
    </Wrapper>
  );
};

const DashboardPage = (id) => {
  const [accessToken, setAccessToken] = useState("");
  const userId = "123456";

  useEffect(() => {
    fetch("/api/get-token/" + userId)
      .then((data) => data.json())
      .then((data) => {
        setAccessToken(data.token);
      });
  }, []);

  return (
    <Wrapper baseUrl={baseUrl} token={accessToken}>
      <Dashboard id={id} />
    </Wrapper>
  );
};

Contributing

You can fork the repository and make a pull request with your changes. Make sure to also update the docs with any relevant changes you have made.

Steps

  • Fork the repository.
  • Clone the repository to your local machine.
  • Install the dependencies using npm install.
  • View the components in the browser using npm run storybook.
  • Make your changes.
  • Test the changes using npm test.
  • Build the library using npm run build.
  • Commit the changes and push them to your forked repository.
  • Publish the package on npm.
  • Install and use the package in your project.