This post explores several common ways of handling visibility of conditional fields. Our sample form will have the following schema:
foo
: always presentbar
: dependent on form state (value of foo)baz
: dependent on other application state (e.g. user permissions)
Below is our form, prior to implementing visibility logic: