rjsf-team/react-jsonschema-form

Make form group collapsable

zengfenfei opened this issue · 8 comments

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

n1k0 commented

This is definitely something we want indeed.

n1k0 commented

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.

n1k0 commented

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.

n1k0 commented

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

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?

n1k0 commented

Would we need a fieldset template?

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

n1k0 commented

Now #304 has landed we can safely close this.