As it appears on your ID
Text
Names, email addresses, reference numbers and NIN. Set the input type and autocomplete for each question.
Lets people type a short answer on one line, such as a name, an email address, a phone number or a reference number.
Updated
As it appears on your ID
Text input
Usage
<div class="nds-text-input"> <div class="nds-text-input__label-row"> <label class="nds-text-input__label" for="first-name"> First name </label> <span class="nds-text-input__required" aria-hidden="true"> * </span> </div> <div class="nds-text-input__control-wrap"> <input class="nds-text-input__control" type="text" id="first-name" name="first-name" aria-describedby="first-name-hint" value="Ada" required /> </div> <p class="nds-text-input__hint" id="first-name-hint"> As it appears on your ID </p></div> WordPress
<!-- wp:nds/text-input {"type":"text"} --><div class="nds-text-input"> <div class="nds-text-input__label-row"> <label class="nds-text-input__label" for="first-name"> First name </label> <span class="nds-text-input__required" aria-hidden="true"> * </span> </div> <div class="nds-text-input__control-wrap"> <input class="nds-text-input__control" type="text" id="first-name" name="first-name" aria-describedby="first-name-hint" value="Ada" required /> </div> <p class="nds-text-input__hint" id="first-name-hint"> As it appears on your ID </p></div><!-- /wp:nds/text-input --> Usage
// Import the componentimport { TextInput } from "@nigerian-design-standards/react";// Use it<TextInput label="First name" hint="As it appears on your ID" value="Ada" required/> Usage
// Import the componentuse NDS\Components\TextInput;// Use itecho TextInput::render([ 'label' => 'First name', 'hint' => 'As it appears on your ID', 'required' => true,]); A text input lets people type a short answer on one line. Every field has a visible label, and a hint only when most people need help to answer.
Four components share the same field style. Pick the one that fits the answer.
As it appears on your ID
Names, email addresses, reference numbers and NIN. Set the input type and autocomplete for each question.
We’ll only call if we need to ask about your message
Nigerian phone numbers. +234 is shown, so people type 10 digits.
Site or service search. No visible label: the placeholder says what it searches.
One question in several fields, like First, Middle (optional) and Last name.
The properties of Form/Input field. The same in HTML, WordPress and React.
| Property | Type | Possible values | Description |
|---|---|---|---|
| type | string |
| Text for most answers. Phone shows a fixed +234 prefix, so people type 10 digits. |
| state | string |
| Active is the field in use: a 2px border/dark (not the keyboard focus ring). Error shows the error message and a red border. Avoid disabled where you can. |
| showLabel | boolean |
| Always on for form fields. The label says what to enter. |
| showHint | boolean |
| Help text under the control. Only when most people need it. |
| required | boolean |
|
Shows an asterisk in the label row and sets the native required attribute.
Use optional instead for “(optional)” when the field is not mandatory.
|
In code, use <label for> with the visible label, aria-describedby
for the hint or error, and aria-invalid="true" in an error. Set type and autocomplete for each question.
| Part | Token | Contrast on the page |
|---|---|---|
| Border | border/strong, 1px | 4.2:1 |
| Border when active | border/dark, 2px | 14.3:1 |
| Border in an error | status/error/surface, 1px (2px when active) | 4.9:1 |
| Typed text | text/primary, Body/medium (16px) | 17.6:1 |
| Disabled | surface/muted fill, border/subtle, text/disabled | Exempt |
| Corners · height · side padding | radius/050 (4px) · spacing/500 (40px tall) · spacing/150 (12px sides) | — |
We’ll only call if we need to ask about your message
Size the field to the answer. A phone number field looks short, so people know what’s expected.
Don’t use placeholder text as a label. It disappears when people type and is too light to read.
How fields are spaced and sized on a form.
How to write labels, hints and error messages. Clear words help everyone fill in a form first time.
Use a short noun phrase: “Email address”, not “Please enter your email”.
Put “(optional)” in the label. Don’t mark required fields with words.
A format, or where to find a number. Not a repeat of the label.
“Enter your first name”, not “Invalid input”. Keep what people typed.
Placeholder text disappears and is too light. Search is the only exception.
First, Middle (optional) and Last name. Never one “Full name” box.
| Write | Don’t write | Why |
|---|---|---|
| Email address | Please enter your email address here | Short, and says what to enter. |
| Middle name (optional) | Middle name | Says it can be left blank. |
| Enter your first name | Invalid input | Says how to fix it. |
| Enter a phone number, like 803 123 4567 | Phone number is wrong | Shows a format that works. |
| First name · Last name | Full name | Official forms ask for names in parts. |
Built on native <input> elements with a visible <label>, so it
works with keyboards, screen readers and browser autofill.
| Key | What it does |
|---|---|
| Tab | Moves to the next field, in the order they appear. |
| Shift + Tab | Moves back to the previous field. |
| Enter | Submits the form. In a search field, runs the search. |
Copy the code for HTML, WordPress or React from the Code tab in Live example. The options are listed under Specifications.
Use Form/Input field, Form/Search field and Form/Input group from 01 Library – Foundations. Don’t detach them.
Is this page useful?