Repository navigation
feat(PageHeader): forward heading attributes from Title - #8768
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
🦋 Changeset detectedLatest commit: bfadcf4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
There was a problem hiding this comment.
🟡 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
asvalues. - 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>
|
|
Integration test results from github/github-ui PR: |

Closes #8474
PageHeader.Titlenow forwards standard heading attributes, includingid, ARIA props, andtabIndex, while keepingasrestricted toh1–h6. Responsive title sizing remains controlled byPageHeader.TitleArea.Changelog
New
PageHeader.Titleaccepts and forwards standard heading attributes.Changed
N/A
Removed
N/A
Rollout strategy
Testing & Reviewing
npx vitest run --project '@primer/react' packages/react/src/PageHeader/PageHeader.test.tsx— passed (41 tests).npm run build -w @primer/doc-genandnpm run type-check -w @primer/react— passed.npx prettier --write packages/react/src/PageHeader/PageHeader.test.tsx packages/react/src/PageHeader/PageHeader.types.test.tsxandnpx eslint --fix packages/react/src/PageHeader/PageHeader.test.tsx packages/react/src/PageHeader/PageHeader.types.test.tsx— passed;git diff --cached --check— passed.