Field
Labelled text input with hint/error wiring and an accent focus ring.
Preview
Label + placeholder
<label class="nx-field">
<span class="nx-field__label">Search jobs</span>
<input class="nx-field__input" placeholder="Type to filter…">
</label><NxField label="Search jobs" placeholder="Type to filter…" />API
React props (NxKit)
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
label | string | Required | Field label text. | |
placeholder | string | undefined | Input placeholder. | |
hint | ReactNode | undefined | Help text under the input (aria-describedby). | |
error | ReactNode | undefined | Error under the input; sets aria-invalid. |
Classes
| Class | Description |
|---|---|
.nx-field | Label wrapper |
.nx-field__label | .72rem/ |
.nx-field__input | Input: hairline border, 10px radius, accent focus ring |
.nx-field__hint | Muted helper text, wire via aria-describedby |
.nx-field__error | Danger helper text, wire via aria-describedby + aria-invalid |
States
invalid
Enter a valid email address
disabled
readonly
hint
Only visible to your team.
Accessibility
- Invalid inputs set aria-invalid="true" + aria-describedby pointing at the .nx-field__error id. The error must already exist in the DOM, not be conditionally unmounted before the describedby read.
- Focus replaces the browser default outline with an accent border + glow. Never remove focus styling without an equivalent.
Do / Don’t
- Do: Always wrap the input in a <label> (or pair an explicit htmlFor).Don't show the error text without also setting aria-invalid + aria-describedby on the input.