QuestionnaireHeader.Subtitle
Displays progress information using an app-owned i18next translation key and formatting.
- Stable unknown
- Release candidate since 1.16.1-rc.3
- Development since 1.16.1-dev.2111+9796905
Displays progress information using an app-owned i18next translation key and formatting.
Overview
The QuestionnaireHeader.Subtitle component automatically displays progress information for questionnaires, showing current page/step information with customizable prefix text. It provides real-time updates as users navigate through the form.
Basic Example
import { QuestionnaireForm } from "@ovok/native";
import { Questionnaire } from "@medplum/fhirtypes";
const questionnaire: Questionnaire = {
resourceType: "Questionnaire",
status: "draft",
title: "Basic Header",
item: [
{
linkId: "1",
text: "What is your name?",
type: "string",
},
],
};
const BasicHeader = () => {
return (
<QuestionnaireForm questionnaire={questionnaire}>
<QuestionnaireForm.Header>
<QuestionnaireForm.Header.Title />
<QuestionnaireForm.Header.Subtitle prefix="Step" />
</QuestionnaireForm.Header>
</QuestionnaireForm>
);
};
export default BasicHeader;Props
Every prop, with its type and description, is listed in the @ovok/native/questionnaire-response-form API reference.
Features
- Automatic Progress Display: Shows current page/step information automatically
- Customizable Prefix: Add custom text before progress information
- Real-time Updates: Updates automatically as user navigates
- Custom Content Override: Replace automatic content with custom text
- Theme Integration: Uses theme colors and typography
Styling
Theme Colors
theme.colors.onSurfaceVariant- Default text colortheme.fonts.bodyMedium- Default typography style
Localization
The component uses these translation keys:
{
"questionnaire-form": {
"header": {
"subtitle": "{currentItemNumber} of {totalItems}"
}
}
}Last updated on
QuestionnaireHeader
The header components provide title display and progress tracking for questionnaire forms. These components work together to create informative headers that guide users through multi-page questionnaires with clear navigation context.
QuestionnaireHeader.Title
Displays the questionnaire title with automatic fallback and customizable styling.