Skip to content

Custom Section/Element #520

@dandzem

Description

@dandzem

Hi,
I want to create custom section object that will follow rules and logic of section, but was already populated with some sections in it.
And same for elements, so to have separate button that when is clicked creates custom element.
I am not TypeScript proficient at all, so it is hard to figure it out without examples.
But as I understood from documentation, that it could be done by modifying properties in

import { addCardObj } from @ginkgo-bioworks/react-json-schema-form-builder;

mods = {
  components: {
    add: (properties) => <MyComponent onClick={() => { addCardObj(properties) }} />
  }
}

Since properties is a object that some parameters could be specified

type properties = {
  schema: object, // FormBuilder schema
  uischema: object, // FormBuilder uiSchema
  mods: object, // FormBuilder mods
  onChange: (newSchema: object, newUiSchema: object) => {
    // update schemas when button clicked...
  },
  definitionData: string, // see: schema.definitions
  definitionUi: string, // see: uischema.definitions
  categoryHash: [string], // see: FormBuilder.onMount()
}; 

I can add my custom schema into parameter schema right?

If you could share some example how it is done or lead me how it should be done, I would really appreciate it.

Thank you in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions