@vertexvis/viewer-react
TypeScript icon, indicating that this package has built-in type declarations

0.21.0 • Public • Published

React Bindings for Vertex Viewer SDK

npm npm (scoped with tag)

This project contains React bindings for Vertex's Viewer SDK. These bindings are auto-generated from @vertexvis/viewer.

Installation

Run yarn add @vertexvis/viewer-react or npm install @vertexvis/viewer-react to add the project as an NPM dependency.

Usage

@vertexvis/viewer includes a component loader, defineCustomElements, that needs to be invoked to register the components with the browser. It also includes a global stylesheet with default styling. Consult your bundlers documentation on how to bundle CSS with your project's bundler.

import React from 'react';
import ReactDom from 'react-dom';

import { defineCustomElements } from '@vertexvis/viewer/loader';
import '@vertexvis/viewer/dist/viewer/viewer.css';

async function main() {
  await defineCustomElement(window);
  ReactDom.render(<App />, document.querySelector("#app"));
}

main();

Next, add one of the components to your React component.

import React from 'react';
import { VertexViewer } from '@vertexvis/viewer-react';

export function App() {
  return (<div>
    <VertexViewer src="urn:vertex:stream-key:123" />
  </div>);
}

Documentation

See @vertexvis/viewer for a full list of components and their documentation.

Dependencies (1)

Dev Dependencies (7)

Package Sidebar

Install

npm i @vertexvis/viewer-react

Weekly Downloads

304

Version

0.21.0

License

MIT

Unpacked Size

103 kB

Total Files

17

Last publish

Collaborators

  • danschultz-vertex
  • jdm717
  • joshskinner-vertex
  • ci-vertex