Best practices
Labels and questions in forms
Good labels make it easier for users to understand what to answer.
A label is the text that tells users what to answer for each field in a form. You can use a description to help users understand difficult terms, or explain why they need to answer. Some call labels question text and descriptions help text.
It is especially important to think about how you ask questions in public services, because users are often afraid of answering incorrectly.
<ds-field class="ds-field">
<label class="ds-label">Last name (This is a label)</label>
<div data-field="description">
If you have more than one last name, type only the very last. If you
have a hyphenated name, type your whole last name. (This is a
description)
</div>
<div class="ds-field-affixes">
<textarea class="ds-input" rows="4"></textarea>
</div>
</ds-field>const WithRowsEn = () => { return ( <Textfield label='Last name (This is a label)' description='If you have more than one last name, type only the very last. If you have a hyphenated name, type your whole last name. (This is a description)' multiline rows={4} /> ); }; render(<WithRowsEn />)
Only ask for information you need.
Consider
- whether you can reuse information you already have about the user
- why you need the information
- what you will do with the information
Think of the text as a conversation
When we address users directly with “you” and “I”, the content feels less technical and more like a conversation. It also makes it easier for users to understand what to answer.
Check that the answer options can be read as a logical response to the label. Consider including answer options users can choose if they do not know what to answer, for example “I am not sure” or “I do not know”.
Do
const DoLabelEn = () => {
return (
<Fieldset>
<Fieldset.Legend>
Have you applied for housing benefit before?
</Fieldset.Legend>
<Radio label='Yes, I have applied before' value='yes' name='meeting' />
<Radio label='No, I have not applied before' value='no' name='meeting' />
<Radio label='I am not sure' value='not-sure' name='meeting' />
</Fieldset>
);
};
render(<DoLabelEn />)<fieldset class="ds-fieldset"><legend class="ds-label">Have you applied for housing benefit before?</legend><ds-field class="ds-field"><input class="ds-input" type="radio" name="meeting" value="yes"/><label class="ds-label" data-weight="regular">Yes, I have applied before</label></ds-field><ds-field class="ds-field"><input class="ds-input" type="radio" name="meeting" value="no"/><label class="ds-label" data-weight="regular">No, I have not applied before</label></ds-field><ds-field class="ds-field"><input class="ds-input" type="radio" name="meeting" value="not-sure"/><label class="ds-label" data-weight="regular">I am not sure</label></ds-field></fieldset>Write short and precise labels
Users prefer short texts, especially when they are stressed, busy or reading on a small screen. Use established wording when you can to keep labels as short as possible.
Choose between established wording, descriptive prompts or questions.
These three ways of writing labels work best in slightly different situations.
- Use established wording when users are not in doubt about what the answer is, for example National identity number and Marital status.
- Use questions when the topic and answer options are less familiar to users. Questions also make the tone feel more approachable.
- Prompts can help make the label shorter and more precise compared to questions.
Do
const DoFormEn = () => {
return (
<Fieldset>
<Textfield label='Name' />
<Textfield
label='Choose a time'
type='time'
style={{ maxWidth: '8rem' }}
/>
<Textfield label='What do you need help with?' multiline rows={4} />
</Fieldset>
);
};
render(<DoFormEn />)<fieldset class="ds-fieldset"><ds-field class="ds-field"><label class="ds-label">Name</label><div class="ds-field-affixes"><input class="ds-input" type="text"/></div></ds-field><ds-field class="ds-field" style="max-width:8rem"><label class="ds-label">Choose a time</label><div class="ds-field-affixes"><input class="ds-input" type="time"/></div></ds-field><ds-field class="ds-field"><label class="ds-label">What do you need help with?</label><div class="ds-field-affixes"><textarea class="ds-input" rows="4"></textarea></div></ds-field></fieldset>Don't
const DontFormEn = () => {
return (
<Fieldset>
<Textfield label='What is your name?' />
<Textfield label='What time of day works for you?' type='time' />
<Textfield label='Scope' multiline rows={4} />
</Fieldset>
);
};
render(<DontFormEn />)<fieldset class="ds-fieldset"><ds-field class="ds-field"><label class="ds-label">What is your name?</label><div class="ds-field-affixes"><input class="ds-input" type="text"/></div></ds-field><ds-field class="ds-field"><label class="ds-label">What time of day works for you?</label><div class="ds-field-affixes"><input class="ds-input" type="time"/></div></ds-field><ds-field class="ds-field"><label class="ds-label">Scope</label><div class="ds-field-affixes"><textarea class="ds-input" rows="4"></textarea></div></ds-field></fieldset>Questions often lead users to answer briefly. If you need a more detailed answer, a prompt may be better, for example “Describe what you need help with during a day”.
Use closed questions when you can
Closed questions are easier to answer than open questions. Users have to formulate the answer themselves when the question is open. A closed question can often be answered with Yes or No, or with obvious answer options. For example, “Which municipality do you live in?”.
Do
const DoClosedEn = () => {
return (
<Fieldset>
<Fieldset.Legend>Do you own the home you live in?</Fieldset.Legend>
<Radio label='Yes' value='yes' />
<Radio label='No' value='no' />
</Fieldset>
);
};
render(<DoClosedEn />)<fieldset class="ds-fieldset"><legend class="ds-label">Do you own the home you live in?</legend><ds-field class="ds-field"><input class="ds-input" type="radio" value="yes"/><label class="ds-label" data-weight="regular">Yes</label></ds-field><ds-field class="ds-field"><input class="ds-input" type="radio" value="no"/><label class="ds-label" data-weight="regular">No</label></ds-field></fieldset>Don't
const DontOpenEn = () => {
return <Textfield label='Describe your housing situation' />;
};
render(<DontOpenEn />)<ds-field class="ds-field"><label class="ds-label">Describe your housing situation</label><div class="ds-field-affixes"><input class="ds-input" type="text"/></div></ds-field>Avoid questions with negations
Questions with negations can be difficult to understand. These are often sentences with “not” or “never”.
Do
const DoNegationsEn = () => {
return (
<Fieldset>
<Fieldset.Legend>Do you have a place to live?</Fieldset.Legend>
<Radio label='Yes' value='yes' />
<Radio label='No' value='no' />
</Fieldset>
);
};
render(<DoNegationsEn />)<fieldset class="ds-fieldset"><legend class="ds-label">Do you have a place to live?</legend><ds-field class="ds-field"><input class="ds-input" type="radio" value="yes"/><label class="ds-label" data-weight="regular">Yes</label></ds-field><ds-field class="ds-field"><input class="ds-input" type="radio" value="no"/><label class="ds-label" data-weight="regular">No</label></ds-field></fieldset>Don't
const DontNegationsEn = () => {
return (
<Fieldset>
<Fieldset.Legend>Do you not have a place to live?</Fieldset.Legend>
<Radio label='Yes' value='yes' />
<Radio label='No' value='no' />
</Fieldset>
);
};
render(<DontNegationsEn />)<fieldset class="ds-fieldset"><legend class="ds-label">Do you not have a place to live?</legend><ds-field class="ds-field"><input class="ds-input" type="radio" value="yes"/><label class="ds-label" data-weight="regular">Yes</label></ds-field><ds-field class="ds-field"><input class="ds-input" type="radio" value="no"/><label class="ds-label" data-weight="regular">No</label></ds-field></fieldset>Give all relevant information before users answer
Users should not have to try and fail, so give them all relevant information before they choose an option or fill in a field. Avoid guidance text inside the input itself, also known as placeholders. Placeholders disappear when the field is filled in, and may conflict with accessibility requirements.
Sometimes descriptions, also known as help text, are useful for explaining something difficult, such as legal terms or specialist language.
Only use descriptions where they are needed, to reduce cognitive load.
Do
const DoPlaceholderEn = () => {
return (
<Textfield
label='Department code'
description='6 digits. You can find it on your payslip.'
/>
);
};
render(<DoPlaceholderEn />)<ds-field class="ds-field"><label class="ds-label">Department code</label><div data-field="description">6 digits. You can find it on your payslip.</div><div class="ds-field-affixes"><input class="ds-input" type="text"/></div></ds-field>Don't
const DontPlaceholderEn = () => {
return (
<Textfield
label='Department code'
placeholder='6 digits'
style={{ minWidth: '24rem' }}
/>
);
};
render(<DontPlaceholderEn />)<ds-field class="ds-field" style="min-width:24rem"><label class="ds-label">Department code</label><div class="ds-field-affixes"><input class="ds-input" type="text" placeholder="6 digits"/></div></ds-field>Build trust by explaining why we ask
It can be useful to briefly explain why we ask for something, to build trust and openness. One way to do this is with an expandable description.
<ds-field class="ds-field" style="width:min(100%, 26rem)">
<label class="ds-label">National identity number</label>
<details
class="ds-details"
style="background:transparent;border-block-width:0"
>
<summary
style="background:transparent;min-height:auto;padding:0"
>Why do we ask for this?</summary>
<div style="margin-block-start:0.5rem;margin-inline:0">
We use your national identity number to find the correct information
about you and make sure the application is registered to the right
person.
</div>
</details>
<input class="ds-input" type="text" inputMode="numeric"/>
</ds-field>const WithExpandableDescriptionEn = () => { const [open, setOpen] = useState(false); return ( <Field style={{ width: 'min(100%, 26rem)' }}> <Label>National identity number</Label> <Details open={open} onToggle={() => setOpen(!open)} style={{ background: 'transparent', borderBlockWidth: 0 }} > <Details.Summary style={{ background: 'transparent', minHeight: 'auto', padding: 0, }} > Why do we ask for this? </Details.Summary> <Details.Content style={{ marginBlockStart: '0.5rem', marginInline: 0 }} > We use your national identity number to find the correct information about you and make sure the application is registered to the right person. </Details.Content> </Details> <Input inputMode='numeric' /> </Field> ); }; render(<WithExpandableDescriptionEn />)