vazco / uniforms

A React library for building forms from any schema.
https://uniforms.tools
MIT License
1.93k stars 239 forks source link

Add Example Of Progressive Disclosure #1335

Closed jbeuckm closed 1 month ago

jbeuckm commented 2 months ago

We need to progressively disclose properties that appear according to if-then conditionals in our json-schema. This does not seem to be possible. The way I think it would have to be done currently is to list all properties at the top level, then conditionally hide the right ones using an arrangement of AutoField components.

Is there a demo of or known way to implement progressive disclosure?

piotrpospiech commented 2 months ago

Hi @jbeuckm, I think it is a similar issue to #845. Does this solve your problem?

kestarumper commented 1 month ago

The way I think it would have to be done currently is to list all properties at the top level, then conditionally hide the right ones using an arrangement of AutoField components.

You're not limited to listing all properties at the top level, but the approach is correct. Have a look at the issue that @piotrpospiech linked (#845). It suggests going with the DisplayIf field.

For a full demo with a complex condition builder, have a look at https://forminer.com/demo.

I'm also closing this issue due to a lack of activity. Feel free to reopen if needed.