Each form field combination of text label and form control may optionally be wrapped in
.env-form-field for consistent spacing. The form field wrapper may also contain a help text using .env-form-field-help.
<formclass="env-form"action="/"><divclass="env-form-field"><labelfor="text-1"class="env-form-label">Input text</label><inputtype="text"class="env-form-input"placeholder="Placeholder text"aria-describedby="text-1-help"id="text-1"/><pid="text-1-help"class="env-form-field-help">Form field help</p></div><buttonclass="env-button env-button--primary">Submit</button></form>
Form control container
The class .env-form-control creates a multi purpose container used to enhance single form controls.
It can only contain elements of the following types:
.env-form-label
.env-form-input
.env-button
.env-icon
[aria-hidden="true"]
Usages
Create an input group with label, input and button with a combinations of elements using .env-form-input, .env-button and .env-form-label.
Make sure to add role="textbox" and aria-multiline="true" to the contenteditable element. The contenteditable element should also have aria-label or aria-labelledby attribute since a native label element is not allowed.
An optional placeholder may be added using attribute aria-placeholder on the contenteditable element.
Updated in 2025.05.1.
With the introduction of Customizable select elements, both the Select element and the Select component support a progressively enhanced approach that applies as much of the Envision styling as possible while maintaining native select element functionality. This feature is opt-in and can be enabled by adding a button with a selectedcontent tag inside the select element.
Select component
A <select> element wrapped in an element with the class .env-form-select will have the most consistent appearance across browsers. The dropdown arrow uses the .env-icon class and can be customized.
To opt in to the customizable version — which uses theme fonts, colors, and allows icons — add a button as the first child of the select, with a selectedcontent element inside the button. Use the .env-icon class to display icons in the options or in the selected value.
Attribute [disabled] may be placed on form elements or fieldset elements to disable the form control(s). Attribute [readonly] is also available for input elements.
<formclass="env-form"action="/"><divclass="env-form-field"><labelfor="text-disabled"class="env-form-label">Disabled text input</label><inputtype="text"class="env-form-input"id="text-disabled"placeholder="Disabled"disabled/></div><divclass="env-form-field"><divclass="env-form-control"><inputclass="env-checkbox"type="checkbox"name="options"id="checkbox-disabled"checkeddisabled/><labelfor="checkbox-disabled"class="env-form-label">
Disabled checkbox
</label></div></div><divclass="env-form-field"><divclass="env-form-control"><inputid="radio-disabled-1"class="env-radio"type="radio"checkeddisabled/><labelfor="radio-disabled-1"class="env-form-label">
Disabled radio button
</label></div></div><fieldsetclass="env-form-fieldset"disabled><legendclass="env-form-legend">Disabled radio button group</legend><divclass="env-form-field"><divclass="env-form-control"><inputid="radio-disabled-2"class="env-radio"type="radio"/><labelfor="radio-disabled-2"class="env-form-label">
Disabled radio button group
</label></div></div><divclass="env-form-field"><divclass="env-form-control"><inputid="radio-disabled-3"class="env-radio"type="radio"checked/><labelfor="radio-disabled-3"class="env-form-label">
Disabled radio button group
</label></div></div></fieldset><divclass="env-form-field"><divclass="env-form-control"><labelfor="switch-disabled"class="env-form-label">
Disabled switch
</label><inputclass="env-switch"type="checkbox"name="options"id="switch-disabled"checkeddisabled/></div></div><divclass="env-form-field"><labelfor="text-readonly"class="env-form-label">Readonly text input</label><inputtype="text"class="env-form-input"id="text-readonly"placeholder="Readonly"readonly/></div></form>
Validation error
Add modifier .env-form-field--error to define error validation state. The aria-describedby attribute should be used to reference the ID of the text that describes the element.
Error validation state uses the Status color Error text.