rjsf-team / react-jsonschema-form

A React component for building Web forms from JSON Schema.

Home Page:https://rjsf-team.github.io/react-jsonschema-form/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make form group collapsable

zengfenfei opened this issue · comments

Since my schema has nested objects and is kind of large, it will be great help to collapse some of objects.

This is definitely something we want indeed.

As often, the hardest part is the UX here. I came with this for now as a programmatic PoC, but am wondering how the UI could expose something convenient and not intrusive. Thoughts?

I feel that it will be better to keep this functionality outside this module and instead support widgets for Array and Object fields in a better way so that people can build this functionality by themselves as a widget. Collapsing is just one option. You can also show as Tabs, for instance.

Very true, and this lib does a lot already so we shouldn't bloat it up with more core features most people won't ever need.

I'll look into #225 to see where we're at to have custom object and array widgets.

A field template system as described in #284 would indeed expose a convenient API to implement this. Let's do this.

commented

Being able to set a wrapping component of a fieldset would solve this. Then you could use tabs or collapsible sections, columns, or anything you wanted. I'd want to be able to define the wrapping component then an object that contains all the props to be passed to it (for tab titles, etc). I don't know that the field template system would be enough since isn't that only at the field level? Would we need a fieldset template?

Would we need a fieldset template?

Yeah this is a good idea, please comment on #284 about it.

Now #304 has landed we can safely close this.