Design System React

AlphaThis a work in progress. Your input will help us to improve it. Report issues or raise questions on GitHub.

Question

Basic question

JSX for this example
<React.Fragment />

Question with error

JSX for this example
<React.Fragment />

Fieldset question

JSX for this example
<React.Fragment />

Fieldset question with error

JSX for this example
<React.Fragment />

Question configuration

Question components can use the following props:

className (optional)
A CSS class name to pass to the component.
errorMessage (optional)
Text for a question's ErrorMessage component. For use when the question uses a fieldset.
hasError (optional)
Whether the question is in an error state. Boolean.
hintText (optional)
Text for a question's HintText component. For use when the question uses a fieldset.
legend (optional)
Text for a question's legend element. Use when the question has a tagName of ‘fieldset’.
tagName (optional)
HTML tag name to use for the question. Default is div, but fieldset will sometimes be more appropriate.

Questions are meaningless without one or more form fields, which should be provided as children.