bpmn-js-react
TypeScript icon, indicating that this package has built-in type declarations

1.0.22 • Public • Published

bpmn-js-react

JavaScript Style Guide All Contributors Issue Open Issue Close

This project is developed for using Use bpmn-js to display BPMN 2.0 diagrams in a React application.

Install

yarn add bpmn-js-react 

or

npm install --save bpmn-js-react

Usage

import { BpmnJsReact,useBpmnJsReact } from "bpmn-js-react";

const ComponentForBpmnViewer = (props) => {
  return <BpmnJsReact xml={xml} />;
};

const ComponentForBpmnModeler = (props) => {

  const bpmnReactJs = useBpmnJsReact();
 
  const saveXml = async () => {
    const result = await bpmnReactJs.saveXml()

    console.log(result?.xml)
  }

  return (
     <div>
         <BpmnJsReact  useBpmnJsReact={bpmnReactJs} mode="edit" xml={xml} />
         <button onClick={()=> saveXml()}>Save Xml</>
     </div>
  );
};

Props

Name Type Description
mode 'view' | 'edit'
xml string xml string of bpmn
height number Default value is 300
click function This function is called when you do click on bpmn elemnt
dbclick function This function is called when you do dbclick on bpmn elemnt

Resources

License

MIT © Majeed Dourandeesh

All Contributors

/bpmn-js-react/

    Package Sidebar

    Install

    npm i bpmn-js-react

    Weekly Downloads

    6

    Version

    1.0.22

    License

    none

    Unpacked Size

    10.5 MB

    Total Files

    20

    Last publish

    Collaborators

    • majeeddl