Imagine that we host an IT conference and want to make a list of guests. Obviously, we want to collect their first name and last name. Additionally, we can ask for their work experience, but that information is not required. Let's prepare a form for the guests, so they can sign up for our event, by using uniforms!
To start using uniforms, we have to install three independent packages:
In this example, we will use the JSONSchema to describe our desired data format and style our form using Semantic UI theme.
npm install uniformsnpm install uniforms-bridge-json-schemanpm install uniforms-semantic
Note: When using a themed package, remember to include correct styles! If you are willing to run this example by yourself, have a read on Semantic UI React's theme usage.
After we've installed required packages, it's time to define our Guest schema. We can do it in a plain JSON, which is a valid JSONSchema instance: