Skip to content

fix: Typography.PaneHeader should render as an h2 #4126

Closed

Description

@adamint

🐛 Bug Report

In fluent dialog headers with a title, said title is rendered with Typography.PaneHeader, which is converted into an h4. This heading level seems too small for the importance of a dialog. As a 'main section' of the page, PaneHeader should render as an h2, both leaving space for many additional sub-header levels and avoiding confusion from skipping levels.

💻 Repro or Code Sample

<FluentLabel Typo="Typography.PaneHeader">@Dialog.Instance?.Parameters?.Title</FluentLabel>

🤔 Expected Behavior

PaneHeader should be rendered as an h2, or if it needs to stay as an h2 to avoid breaking existing code, dialog headers should render an h2 title.

🔦 Context

We ended up getting bit by a related bug in Aspire, where we were rendering h3 in the dialog body. As h3>h4, an accessibility defect was filed against us. While fixable by changing our h3 to h5, rendering dialog titles as h4 is still too low of a heading level.

Activity

  1. added
    triage
    on Sep 11, 2025
  2. dvoituron commented on Sep 11, 2025

    @dvoituron
    Collaborator

    To avoid breaking changes in the v4, I don't think we can update that now. But you can apply a CSS to define a correct text size.

    We can change that for the v5.

  3. vnbaaij commented on Sep 11, 2025

    @vnbaaij
    Collaborator

    We could add a parameter for v4 to specify a header size (which defaults to the current h4)

  4. added
    status:needs-investigation
    and removed
    triage
    on Sep 11, 2025
  5. dvoituron commented on Sep 11, 2025

    @dvoituron
    Collaborator

    We could add a parameter for v4 to specify a header size (which defaults to the current h4)

    Yeah. Good idea

  6. added a commit that references this issue on Sep 12, 2025
    95939fb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:needs-investigation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions