InputField

Accessibility

  • For special cases you can use your own, detached label. Simply like this:
<label for="NICEID">Content</label>
<InputField
id="NICEID"
/>
<InputField label="Password" type="password" ariaDescribedby="password-requirements" />
<p id="password-requirements" style={{ display: "none", visibility: "hidden" }}>
Password must be at least 8 characters long and include at least one uppercase letter and one number.
</p>
<InputField label="Username" error="This username is already taken" />
<p id="email-hint" style={{ display: "none", visibility: "hidden" }}>
We'll never share your email with anyone else.
</p>
<InputField label="Email" error="Invalid email format" ariaDescribedby="email-hint" />

InputGroup Integration

Example 1

<InputGroup label="Passenger details" error="Incomplete information">
<InputField label="First name" />
<InputField label="Last name" />
</InputGroup>

Example 2

<InputGroup label="Passenger details">
<InputField label="First name" />
<InputField label="Last name" error="Last name is required" />
</InputGroup>

Example 3

<InputGroup label="Contact information">
<Select options={countryOptions} label="Country" />
<InputField
label="Phone number"
ariaDescribedby="phone-hint" // This will be overwritten
/>
<p id="phone-hint" style={{ display: "none", visibility: "hidden" }}>
Enter your phone number
</p>
</InputGroup>