Skip to content

feat(PageHeader): forward heading attributes from Title - #8768

Merged
adierkens merged 2 commits into
mainfrom
adierkens-pageheader-title-id
Nov 17, 2026
Merged

adierkens merged 2 commits into
mainfrom
adierkens-pageheader-title-id

Conversation

@adierkens

@adierkens adierkens commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Closes #8474

PageHeader.Title now forwards standard heading attributes, including id, ARIA props, and tabIndex, while keeping as restricted to h1–h6. Responsive title sizing remains controlled by PageHeader.TitleArea.

Changelog

New

  • PageHeader.Title accepts and forwards standard heading attributes.

Changed

N/A

Removed

N/A

Rollout strategy

  • No changes needed in github/github-ui
  • Needs changes in github/github-ui
  • Ships with feature flag(s)
  • Not sure
  • None

Testing & Reviewing

  • npx vitest run --project '@primer/react' packages/react/src/PageHeader/PageHeader.test.tsx — passed (41 tests).
  • npm run build -w @primer/doc-gen and npm run type-check -w @primer/react — passed.
  • npx prettier --write packages/react/src/PageHeader/PageHeader.test.tsx packages/react/src/PageHeader/PageHeader.types.test.tsx and npx eslint --fix packages/react/src/PageHeader/PageHeader.test.tsx packages/react/src/PageHeader/PageHeader.types.test.tsx — passed; git diff --cached --check — passed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: bfadcf4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

@github-actions
github-actions Bot temporarily deployed to storybook-preview-8768 November 16, 2026 20:51 Inactive
@github-actions github-actions Bot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed integration-tests: failing Changes in this PR cause breaking changes in gh/gh labels Nov 16, 2026
@adierkens
adierkens marked this pull request as ready for review November 16, 2026 21:40
@adierkens
adierkens requested a review from a team as a code owner November 16, 2026 21:40
@adierkens
adierkens requested review from siddharthkp and a balanced review from Copilot November 16, 2026 21:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

PageHeader.Title inherits ref support without forwarding refs, causing object refs to remain null and React 18 to emit a warning.

1 open issue
What changed in this PR

This PR addresses #8474 by allowing PageHeader.Title to accept and forward standard heading attributes, while preserving heading-only rendering and responsive sizing through PageHeader.TitleArea.

Changes:

  • Extends title props and forwards attributes to the underlying Heading.
  • Adds runtime and type coverage for heading attributes and restricted as values.
  • Updates API documentation and adds a minor-release changeset.
File Description
packages/​react/​src/​PageHeader/​PageHeader.types.test.tsx Checks heading attributes and rejects non-heading elements.
packages/​react/​src/​PageHeader/​PageHeader.tsx Expands title props and forwards heading attributes.
packages/​react/​src/​PageHeader/​PageHeader.test.tsx Verifies attributes reach the rendered heading.
packages/​react/​src/​PageHeader/​PageHeader.docs.json Documents heading levels and attribute forwarding.
.changeset/​quiet-rings-forward.md Records the public API addition for release.

Review effort: Balanced

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

@adierkens
adierkens marked this pull request as draft November 16, 2026 22:02
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8768 November 16, 2026 22:16 Inactive
@github-actions github-actions Bot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh labels Nov 16, 2026
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8768 November 17, 2026 00:24 Inactive
@adierkens
adierkens marked this pull request as ready for review November 17, 2026 16:19
@primer-integration

primer-integration Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Integration test results from github/github-ui PR:

Running  Changes   Running
Passed  CI   Passed
Waiting  VRT   Waiting
Waiting  Projects   Waiting

@github-actions github-actions Bot added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed integration-tests: failing Changes in this PR cause breaking changes in gh/gh labels Nov 17, 2026
@adierkens
adierkens added this pull request to the merge queue Nov 17, 2026
@adierkens adierkens mentioned this pull request Nov 17, 2026
1 task done
Merged via the queue into main with commit 31c717c Nov 17, 2026
75 of 77 checks passed
@adierkens
adierkens deleted the adierkens-pageheader-title-id branch November 17, 2026 17:23
@primer primer Bot mentioned this pull request Nov 17, 2026

This branch was successfully deployed

1 active and 1 inactive deployments
storybook-preview-8768 — bfadcf48 Deployed Nov 17, 2026 by github-actions[bot]
github-pages — bfadcf48 Deployed Nov 17, 2026 by adierkens via deploy-preview #34357
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PageHeader.Title does not seem to accept id prop

3 participants