Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Section/Element #520

Open
dandzem opened this issue Nov 13, 2023 · 0 comments
Open

Custom Section/Element #520

dandzem opened this issue Nov 13, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@dandzem
Copy link

dandzem commented Nov 13, 2023

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!

@raymond-lam raymond-lam added the enhancement New feature or request label Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants