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 color
  • theme.fonts.bodyMedium - Default typography style

Localization

The component uses these translation keys:

{
  "questionnaire-form": {
    "header": {
      "subtitle": "{currentItemNumber} of {totalItems}"
    }
  }
}

Last updated on

On this page