Skip to content

Forms

IFormField ​

The label, description, hint, help and error around a control. It generates an id, points the label at it, links the description and error with aria-describedby, and sets invalid on the control.

Shown to the client on the PDF.

You do not pass an id — the field makes one and wires both ends.

Hint and help ​

hint sits at the end of the label row — for "Optional", a character count, a link to a definition. help sits under the control, for guidance that is not an error.

Optional

Leave blank if the client is outside the EU.

Required ​

Errors ​

Inside an IForm, name connects the field to a validation error and the message appears on its own. Set error by hand only outside a form.

An error replaces the help text rather than stacking with it.

Any control ​

The wiring reaches every field in the library, including composed ones like IPasswordInput and multi-part ones like ISelect, whose attributes land on the trigger.

Only you can see these.

ICheckbox, ISwitch and IRadioGroup carry their own label. Inside a field, set the text on the field and leave the control's own label off, or it is announced twice.

Props ​

PropTypeDefaultDescription
namestring—Dot-path connecting the field to a form error
labelstring—Label text
descriptionstring—Text under the label, linked to the control
hintstring—End of the label row
helpstring—Under the control; replaced by an error
requiredbooleanfalseAdds the asterisk
errorstring—Error message; supplied by IForm when inside one
unstyledboolean—Drop built-in classes
classstring—Merged with the built-in classes
ui{ root?, header?, label?, hint?, description?, error?, help? }—Per-element class overrides

Slots ​

SlotWhen to use it
defaultThe control
hintThe hint needs markup, such as a link