Select
Allowing our members the freedom to choose
Remember, when working with forms, add the
aria-describedby
attribute, and some helpful text, to allow
a seamless experience for everybody.
Keep your form on a white background to enable full contrast ratios for form validation messages.
While using input type="number"
users could accidentally increase or decrease the number using the
scroll wheel on the mouse or the scroll gesture on their trackpad. This
feature can be useful when collecting countable data but bad if entering
data such as passport numbers. We have switched to
input type="text" inputmode="numeric" pattern="[0-9]*"
because it allows for a degree of separation between how the user enters
data (“input mode”), what the browser expects the user input to contain
(type equals number), and potentially how it tries to validate it.
How we design them
Remember to add the aria-describedby
attribute, and some helpful text, to allow a seamless experience for everybody.
Select components need to be a child of a form.
How they look
View demoView code
<form>
<select name="number" class="gg-c-select" aria-describedby="choose a number">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</form>
Previous versions
If you’re using a version of the Design System that is older than 58.1.6, your select component will have a different icon:
View demoView code
<form>
<select name="number" class="gg-c-select" aria-describedby="choose a number">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</form>
<style>
.gg-c-select {
background-image: svg('ggm--icon-chevron__down-black.svg');
}
</style>