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

0.0.14 • Public • Published

React Bindings for Vertex Component library

npm npm (scoped with tag)

Project contains React bindings for Vertex's component library SDK. These bindings are auto-generated from @vertexvis/ui.

Usage

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

The project includes a component loader, defineCustomElements, that needs to be invoked in order for the elements to be loaded and rendered.

import React from 'react';
import ReactDom from 'react-dom';
import { defineCustomElements } from '@vertexvis/ui-react';

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

main();

If you plan on targeting IE11 or Edge <= 18, you'll also need to supply polyfills for the Web Components APIs (Custom Elements, Shadow DOM, CSS Variables, etc). To include the polyfills, import applyPolyfills from the loader.

import React from 'react';
import ReactDom from 'react-dom';
import { applyPolyfills, defineCustomElements } from '@vertexvis/ui-react';

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

main();

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

import React from 'react';
import { VertexButton } from '@vertexvis/ui-react';

export function App() {
  return (<div>
    <VertexButton color="primary">
      Button
    </VertexButton>
  </div>);
}

Readme

Keywords

none

Package Sidebar

Install

npm i @vertexvis/ui-react

Weekly Downloads

225

Version

0.0.14

License

MIT

Unpacked Size

149 kB

Total Files

23

Last publish

Collaborators

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