-
Notifications
You must be signed in to change notification settings - Fork 60
Hero component updates #1220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Hero component updates #1220
Conversation
🦋 Changeset detectedLatest commit: 7ba1e53 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
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 |
🟢 No design token changes found |
🟢 Unit test coverage changes foundUnit test coverage has been updated through this PR. Changes: 0 new tests, 0 removed tests, 1 improved, 1 decreased
|
🟢 No visual differences foundOur visual comparison tests did not find any differences in the UI. |
…o-component-brand-refactor
…o-component-brand-refactor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements Hero component updates aligning with the 2026 brand refresh, introducing new visual variants, animation capabilities, and making several breaking API changes.
Changes:
- Introduces new
bordered-gridvariant for Hero with grid lines and contained layout - Adds TextCursorAnimation component with cursor reveal effect for Hero labels
- Implements new animation hooks (useReducedMotion, useCursorAnimation) and
reveal-in-upanimation - Refactors Hero component architecture with sub-components and context API
- Updates Hero.Description and Hero.Label default styling (breaking changes)
- Adds video poster support with play button overlay
Reviewed changes
Copilot reviewed 49 out of 146 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
.changeset/tiny-dingos-speak.md |
Documents breaking changes and new features for Hero component |
packages/react/src/Hero/Hero.tsx |
Major refactor with new variant system, context provider, and layout improvements |
packages/react/src/Hero/HeroContext.ts |
New context for managing Hero state and variants |
packages/react/src/Hero/sub-components/* |
New sub-component architecture for Hero elements |
packages/react/src/TextCursorAnimation/* |
New animated text cursor component |
packages/react/src/hooks/useReducedMotion.ts |
New hook for respecting user motion preferences |
packages/react/src/hooks/useCursorAnimation.ts |
New hook for cursor animation logic |
packages/react/src/animation/* |
Adds reveal-in-up animation and immediate trigger support |
packages/react/src/Hero/Hero.module.css |
Extensive CSS updates for new variants and layouts |
packages/react/src/recipes/* |
Updates to use new Hero API with backwards compatibility |
packages/react/src/Hero/Hero.test.tsx |
Updated tests with matchMedia mock for new hooks |
apps/next-docs/content/components/Hero/react.mdx |
Documentation updates for new props and features |
Comments suppressed due to low confidence (2)
packages/react/src/Hero/Hero.module.css:223
- According to the custom coding guidelines (ID: 1000000), hardcoded pixel values should not be used in CSS module files. The
letter-spacing: 1pxshould be replaced with an appropriate design token.
letter-spacing: 1px;
packages/react/src/Hero/Hero.module.css:106
- According to the custom coding guidelines (ID: 1000000), hardcoded pixel values should not be used in CSS module files. The hardcoded
600pxincalc(600px - var(--base-size-24))should be replaced with an appropriate size token from the design tokens.
min-height: calc(600px - var(--base-size-24));
|
|
||
| .Hero-description { | ||
| margin: var(--base-size-24) 0 0; | ||
| max-width: 600px; |
Copilot
AI
Jan 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the custom coding guidelines (ID: 1000000), hardcoded pixel values should not be used in CSS module files. The max-width: 600px should be replaced with an appropriate size token from the design tokens. Additionally, the letter-spacing: 1px on line 223 should also use a design token.
This issue also appears in the following locations of the same file:
- line 223
- line 106
|
|
||
| #### Breaking Changes | ||
|
|
||
| - **`Hero.Label`**: No longer extends `Label` component. It now renders as plan text with monospace font and in uppercase. Props like `size` and `color` are no longer supported. |
Copilot
AI
Jan 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a spelling error: "plan text" should be "plain text".
| - **`Hero.Label`**: No longer extends `Label` component. It now renders as plan text with monospace font and in uppercase. Props like `size` and `color` are no longer supported. | |
| - **`Hero.Label`**: No longer extends `Label` component. It now renders as plain text with monospace font and in uppercase. Props like `size` and `color` are no longer supported. |
|
|
||
| .Animation--reveal-in-up.Animation--active { | ||
| transform: translateY(0); | ||
| clip-path: inset(0 0 -0.2em 0); /* includs some offset to account for descenders */ |
Copilot
AI
Jan 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a spelling error in the comment: "includs" should be "includes".
| * Loads after the page has fully loads | ||
| */ | ||
| waitForPageLoad?: boolean |
Copilot
AI
Jan 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a grammatical error in the JSDoc comment: "Loads after the page has fully loads" should be "Loads after the page has fully loaded".
| }, | ||
| ) | ||
|
|
||
| function PosterImage({posterSrc, posterAlt, posterTitle, onClick, className}) { |
Copilot
AI
Jan 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PosterImage function parameters lack TypeScript type annotations. Consider adding proper types for posterSrc, posterAlt, posterTitle, onClick, and className parameters to maintain type safety and consistency with the rest of the codebase.
| top: 50%; | ||
| transform: translateY(calc(-50% - 1px)); | ||
| width: var(--base-size-8); | ||
| height: 11px; |
Copilot
AI
Jan 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the custom coding guidelines (ID: 1000000), hardcoded pixel values should not be used in CSS module files. Instead, use size tokens from the design tokens. The height: 11px should be replaced with an appropriate size token from packages/design-tokens/lib/design-tokens/css/tokens/base/size/size.css.
|
@rezrah For the full width variants that use video like Bordered grid variant (Block-end w/ video), can we implement two versions (may have missed the floating video version w/ grid; could only find the anchored / block-end w/ grid in Storybook):
|


Summary
Towards https://github.com/github/brand-marketing-design/issues/2606
Aligns the Hero component to the 2026 brand refresh.
🔗 Preview in Storybook
List of notable changes:
What should reviewers focus on?
Steps to test:
Contributor checklist:
update snapshotslabel to the PR)Reviewer checklist:
Screenshots: