Hi
I am trying to incorporate the forms playground component into my app but the sidebard with all the different form fields you can drag and drop is not showing up. And I am finding the documentation is very limiting. Can anyone please help me out?
Here is what I have so far
import React, { CSSProperties, useEffect, useRef, useState } from 'react'
import { createFormEditor } from "@bpmn-io/form-js";
import { Playground } from '@bpmn-io/form-js-playground';
import '@bpmn-io/form-js/dist/assets/dragula.css'
import '@bpmn-io/form-js/dist/assets/form-js.css'
import '@bpmn-io/form-js/dist/assets/form-js-editor.css'
import '@bpmn-io/form-js/dist/assets/properties-panel.css'
import '@bpmn-io/form-js/dist/assets/form-js-playground.css'
// import schema from './schema.json'
const BpmnForms = () => {
const data = {
creditor: "John Doe Company",
amount: 456,
invoiceNumber: "C-123",
approved: true,
approvedBy: "John Doe"
};
const schema = {
schemaVersion: 3,
exporter: {
name: "form-js (https://demo.bpmn.io)",
version: "0.3.0"
},
components: [
{
key: "name",
label: "Text Field",
type: "textfield",
id: "Field_1jfqw1v",
description: "Enter your name ...",
validate: {
required: true,
minLength: 3,
maxLength: 50
}
}
],
type: "default",
id: "Form_1f88rws"
}
useEffect(() => {
const playground = new Playground({
container: document.querySelector('#container'),
schema,
data
});
}, [])
return(
<div>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,600;1,400&display=swap" rel="stylesheet"/>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono&display=swap" rel="stylesheet"></link>
<div id="container" style={{ width: '75%', height: '80%'}}></div>
</div>
)
};
export default BpmnForms;
And here is what is displayed