@bpmn-io/diagram-js-ui
TypeScript icon, indicating that this package has built-in type declarations

0.2.3 • Public • Published

diagram-js-ui

CI

A wrapper around htm/preact that exposes components for building reactive HTML widgets in the context of diagram-js and extensions.

Usage

This module is available through diagram-js/lib/ui. Use it to create and mount your Preact components and render them through the htm utility.

// MyService.js
import { render, html } from 'diagram-js/lib/ui';
import MyCounter from './MyCounter';

export default function MyService() {
  const parentElement = document.createElement('div');

  render(html`<${MyCounter} />`, parentElement);
}
// MyCounter.js
import { useState, html } from 'diagram-js/lib/ui';

export default function MyCounter(props) {
  const counter = useState(0);

  return html`
    <div>Counter: ${counter}</div>
  `;
}

Build and Run

# install all dependencies
npm install

# lint and build the library
npm run all

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @bpmn-io/diagram-js-ui

Weekly Downloads

33,146

Version

0.2.3

License

MIT

Unpacked Size

4.34 kB

Total Files

5

Last publish

Collaborators

  • misiekhardcore
  • abdul99ahad
  • jarekdanielak
  • vsgoulart
  • skaiir-camunda
  • bpmn-io-admin
  • nikku
  • barmac
  • philippfromme
  • maxtru