Skip to content

Commit

Permalink
chore: cleaned up usage examples in READMEs across repo
Browse files Browse the repository at this point in the history
Closes #1175
  • Loading branch information
Skaiir authored and vsgoulart committed Sep 10, 2024
1 parent 907fe69 commit 58cf13b
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/form-js-editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ npm install @bpmn-io/form-js-editor
import { FormEditor } from '@bpmn-io/form-js-editor';

const schema = {
type: 'default',
components: [
{
key: 'creditor',
Expand Down
18 changes: 18 additions & 0 deletions packages/form-js-playground/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,24 @@ Integrate the playground into your application:
```javascript
import { Playground } from '@bpmn-io/form-js-playground';

const schema = {
type: 'default',
components: [
{
key: 'creditor',
label: 'Creditor',
type: 'textfield',
validate: {
required: true,
},
},
],
};

const data = {
creditor: 'John Doe Company',
};

const playground = new Playground({
container: document.querySelector('#container'),
schema,
Expand Down
1 change: 1 addition & 0 deletions packages/form-js-viewer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ npm install @bpmn-io/form-js-viewer
import { Form } from '@bpmn-io/form-js-viewer';

const schema = {
type: 'default',
components: [
{
key: 'creditor',
Expand Down
36 changes: 36 additions & 0 deletions packages/form-js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,24 @@ Renders a form based on [a form schema](./docs/FORM_SCHEMA.md) and existing data
```javascript
import { Form } from '@bpmn-io/form-js';

const schema = {
type: 'default',
components: [
{
key: 'creditor',
label: 'Creditor',
type: 'textfield',
validate: {
required: true,
},
},
],
};

const data = {
creditor: 'John Doe Company',
};

const form = new Form({
container: document.querySelector('#form'),
});
Expand Down Expand Up @@ -51,6 +69,24 @@ Create and simulate a form with input and output data:
```javascript
import { FormPlayground } from '@bpmn-io/form-js';

const schema = {
type: 'default',
components: [
{
key: 'creditor',
label: 'Creditor',
type: 'textfield',
validate: {
required: true,
},
},
],
};

const data = {
creditor: 'John Doe Company',
};

const formPlayground = new FormPlayground({
container: document.querySelector('#form-playground'),
schema,
Expand Down

0 comments on commit 58cf13b

Please sign in to comment.