Field
A native <label> that wraps a label, a control, and an optional hint or validation message in a single accessible block.
Basic field
Section titled “Basic field”<label class="re-field" id="field-basic">
<span class="re-field__label">Email</span>
<input class="re-input" type="email" name="email" id="field-basic-input" required />
<span class="re-field__hint" id="field-basic-hint">Use your work email.</span>
</label> Required marker
Section titled “Required marker”<label class="re-field">
<span class="re-field__label" data-required>Full name</span>
<input class="re-input" type="text" name="name" required id="field-required-input" />
</label> With validation message
Section titled “With validation message”<label class="re-field">
<span class="re-field__label">Password</span>
<input
class="re-input"
type="password"
name="password"
aria-invalid="true"
aria-describedby="field-invalid-msg"
id="field-invalid-input"
/>
<span id="field-invalid-msg" class="re-validation-message">
Must be at least 8 characters.
</span>
</label> Inline (checkbox / radio)
Section titled “Inline (checkbox / radio)”<div class="stack">
<label class="re-field re-field--inline">
<input class="re-checkbox" type="checkbox" id="field-inline-cb" />
<span class="re-field__label">Receive marketing email</span>
</label>
</div> Accessibility
Section titled “Accessibility”The field is a layout helper with no behavior or JavaScript of its own — keyboard and focus come entirely from the native control you wrap.
- Keyboard — Whatever the wrapped control offers natively:
Tabmoves into the.re-input(or.re-checkbox/.re-radio) andSpacetoggles a checkbox/radio. The field adds nothing on top. - Focus — The control shows a visible
:focus-visiblering (--re-shadow-focus); the default outline is replaced, not removed. An invalid control (below) swaps in a danger-colored ring. The wrapping<label>is not itself focusable. - Semantics —
.re-fieldis a native<label>, so the control it wraps inherits the label implicitly — nofor/idpairing required. Mark an error message witharia-invalid="true"on the control and pointaria-describedbyat the.re-validation-message(as the validation example does) so assistive tech reads the message with the field. Hints work the same way: give.re-field__hintanidand reference it from the control’saria-describedby. - Notes — The required asterisk from
.re-field__label[data-required]is a CSS::afterglyph (visual only, not announced); always pair it with the nativerequiredattribute so the requirement is actually conveyed. Validation tones (.re-validation-message[data-tone="…"]) are carried by color and text, not by role, so don’t rely on color alone. Checkbox/radio checked states are re-established underforced-colors: active(Windows High Contrast). See the accessibility guide for the project-wide stance.