Show a simple progress indicator on a question page with multiple questions
<GoabxLink leadingIcon="arrow-back" size="small" mb="none">
Back
</GoabxLink>
<GoabText as="h3" size="body-m" mt="xl" mb="none" color="secondary">Step 1 of 5</GoabText>
<GoabText as="h2" mt="xs" mb="xl">Personal information</GoabText>
<GoabxFormItem label="What is your name?">
<GoabxInput onChange={() => {}} name="name" ariaLabel="what is your name?" width="50ch" />
</GoabxFormItem>
<GoabxFormItem label="What is your phone number?" mt="l">
<GoabxInput
onChange={() => {}}
name="phone-number"
ariaLabel="what is your phone number?"
leadingContent="+1"
/>
</GoabxFormItem>
<GoabxFormItem label="What is your home postal code?" mt="l">
<GoabxInput
onChange={() => {}}
name="postal-code"
width="14ch"
ariaLabel="what is your home postal code"
/>
</GoabxFormItem>
<GoabxButton type="submit" mt="2xl">
Save and continue
</GoabxButton>a.back-link::before {
content: "";
display: inline-block;
width: 42px;
height: 24px;
vertical-align: middle;
background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 2 22 22" fill="none" stroke="%230070C4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg>') center center no-repeat;
}
a.back-link:visited::before,
a.back-link:hover::before {
background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 2 22 22" fill="none" stroke="%23004f84" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg>') center center no-repeat;
}
a.back-link {
margin-top: var(--goa-space-m);
}
h3.section-title {
margin-bottom: 0;
color: var(--goa-color-text-secondary);
}
a.back-link + h3 {
margin-top: var(--goa-space-2xl);
}
h3.section-title + h2 {
margin-top: var(--goa-space-xs);
}onChange(event: Event): void {
const detail = (event as CustomEvent).detail;
console.log("Value:", detail.value);
}<goabx-link leadingIcon="arrow-back" size="small" mb="none">
Back
</goabx-link>
<goab-text as="h3" size="body-m" mt="xl" mb="none" color="secondary">Step 1 of 5</goab-text>
<goab-text as="h2" mt="xs" mb="xl">Personal information</goab-text>
<goabx-form-item label="What is your name?">
<goabx-input (onChange)="onChange($event)" name="name" ariaLabel="what is your name?" width="50ch"></goabx-input>
</goabx-form-item>
<goabx-form-item label="What is your phone number?" mt="l">
<goabx-input (onChange)="onChange($event)" name="phone-number" ariaLabel="what is your phone number?">
<div slot="leadingContent">+1</div>
</goabx-input>
</goabx-form-item>
<goabx-form-item label="What is your home postal code?" mt="l">
<goabx-input (onChange)="onChange($event)" name="postal-code" width="14ch" ariaLabel="what is your home postal code"></goabx-input>
</goabx-form-item>
<goabx-button type="submit" mt="2xl">
Save and continue
</goabx-button>document.querySelectorAll('goa-input').forEach(input => {
input.addEventListener('_change', (e) => {
console.log(`${e.target.name}:`, e.detail.value);
});
});<goa-link leadingicon="arrow-back" size="small" mb="none">
Back
</goa-link>
<goa-text as="h3" size="body-m" mt="xl" mb="none" color="secondary">Step 1 of 5</goa-text>
<goa-text as="h2" mt="xs" mb="xl">Personal information</goa-text>
<goa-form-item version="2" label="What is your name?">
<goa-input version="2" name="name" aria-label="what is your name?" width="50ch"></goa-input>
</goa-form-item>
<goa-form-item version="2" label="What is your phone number?" mt="l">
<goa-input version="2" name="phone-number" aria-label="what is your phone number?">
<div slot="leadingContent">+1</div>
</goa-input>
</goa-form-item>
<goa-form-item version="2" label="What is your home postal code?" mt="l">
<goa-input version="2" name="postal-code" width="14ch" aria-label="what is your home postal code"></goa-input>
</goa-form-item>
<goa-button version="2" type="submit" mt="2xl">
Save and continue
</goa-button>Show a simple progress indicator on a question page when grouping multiple related questions together.
When to use
Use this pattern when:
- Grouping multiple related questions on a single page improves the user experience
- The questions form a logical unit (e.g., personal information fields)
- Users benefit from progress tracking across the form
- A step-based indicator shows progress through form sections
Considerations
- Display progress as “Step X of Y” when grouping questions into sections
- Include a clear section heading that describes the group of questions
- Use a subdued text color for the progress indicator
- Include a back link for navigation to previous sections
- Position related questions close together with consistent spacing
- The
leadingContentprop on inputs can add prefixes like country codes