Skip to content

Hero batch updates: Add ActionMenu to Hero and ButtonGroup changes, full-bleed media and more - #1413

Merged
rezrah merged 15 commits into
mainfrom
rezrah/add-native-actionmenu-hero
Jul 28, 2026
Merged

Hero batch updates: Add ActionMenu to Hero and ButtonGroup changes, full-bleed media and more#1413
rezrah merged 15 commits into
mainfrom
rezrah/add-native-actionmenu-hero

Conversation

@rezrah

@rezrah rezrah commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Resolves #1390
Resolves #1396
Resolves #1422

Adds support for ActionMenu in ButtonGroup, which subsequently allows the former to be used in both Hero and CTABanner.

This is deprecation moment for Hero.PrimaryAction and Hero.SecondaryAction.

I also fixed an outdated Hero+Card combination while modifying Hero stories.

Update: Also added "full bleed" (no padding) option to hero media and river. ⚠️ This is a breaking change ⚠️

List of notable changes:

  • Added ActionMenu child detection to ButtonGroup
  • Added ButtonGroup support to Hero
  • Added stories that show this feature working to all affected components
  • Updated the Hero+Cards fixtures
  • Adds a full bleed Hero visual in gridline variant
  • Adds a full bleed River visual in gridline variant
  • Adds corner inset River visuals for gridline variants

Steps to test:

  1. See River changes here
  2. See updated Hero with ActionMenu here
  3. See ActionMenu in CTABanner here

Supporting resources (related issues, external links, etc):

Contributor checklist:

  • All new and existing CI checks pass
  • Tests prove that the feature works and covers both happy and unhappy paths
  • Any drop in coverage, breaking changes or regressions have been documented above
  • UI Changes contain new visual snapshots (generated by adding update snapshots label to the PR)
  • All developer debugging and non-functional logging has been removed
  • Related issues have been referenced in the PR description

Reviewer checklist:

  • Check that pull request and proposed changes adhere to our contribution guidelines and code of conduct
  • Check that tests prove the feature works and covers both happy and unhappy paths
  • Check that there aren't other open Pull Requests for the same update/change

Screenshots:

Screenshot 2026-07-27 at 16 01 18 image
Before After
image image

Copilot AI review requested due to automatic review settings July 21, 2026 10:51
@rezrah
rezrah requested a review from a team as a code owner July 21, 2026 10:51
@changeset-bot

changeset-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9e9d80e

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

This PR includes changesets to release 9 packages
Name Type
@primer/react-brand Minor
@primer/brand-css Minor
@primer/brand-primitives Minor
@primer/brand-docs Minor
@primer/brand-e2e Minor
@primer/brand-fonts Minor
@primer/brand-mcp Minor
@primer/brand-config Minor
@primer/brand-storybook 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 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

🔍 Design token changes found

View CSS variable changes
+ --brand-River-variant-gridline-visual-padding: var(--base-size-32);
+ --brand-River-variant-gridline-visual-padding: var(--base-size-64);

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

🟢 Bundle size report

CheckMainBranchChange
UMD — full bundle (JS)101.62 kB101.73 kB⬆️ +116 B (+0.1%)
UMD — full bundle (CSS)67.00 kB67.49 kB⬆️ +497 B (+0.7%)
ESM — full bundle (JS + CSS)1.52 MB1.59 MB⬆️ +71.22 kB (+4.6%)
ESM — tree-shaken simple (Button)70.20 kB70.71 kB⬆️ +520 B (+0.7%)
ESM — tree-shaken complex (ActionMenu)79.06 kB79.67 kB⬆️ +631 B (+0.8%)

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

🟢 Unit test coverage changes found

Unit test coverage has been updated through this PR.

Changes: 0 new tests, 0 removed tests, 3 improved, 1 decreased

Component/Hook Statements Functions Branches Change
ButtonGroup 90.0% 100.0% 100.0% 85.7% 100.0% +14.3%
Hero 93.8% 94.0% 88.9% 92.4% 92.5% +0.3%
River 100.0% 100.0% 96.9% 97.6% +0.7%
RiverBreakout 100.0% 100.0% 87.5% 83.3% -4.2%

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds first-class ActionMenu support to action slots by teaching ButtonGroup to accept ActionMenu children, and introducing Hero.ButtonGroup as the new recommended way to render Hero actions (deprecating Hero.PrimaryAction / Hero.SecondaryAction). This aligns Hero/CTABanner action composition with the same underlying grouping behavior and updates stories/docs/tests accordingly.

Changes:

  • Extend ButtonGroup to accept ActionMenu children and apply positional variants automatically.
  • Add Hero.ButtonGroup wrapper and deprecate legacy Hero action subcomponents.
  • Update Storybook stories, docs (next-docs), and visual/unit tests to cover the new API and refreshed Hero+Cards example.
Show a summary per file
File Description
packages/react/src/ButtonGroup/ButtonGroup.tsx Accept ActionMenu children and apply default variants.
packages/react/src/ButtonGroup/ButtonGroup.test.tsx Add unit coverage for ActionMenu children and variant overrides.
packages/react/src/ButtonGroup/ButtonGroup.stories.tsx Add Storybook examples for ActionMenu + overrides.
packages/react/src/ButtonGroup/ButtonGroup.visual.spec.ts Add visual coverage for ActionMenu and overrides.
packages/react/src/Hero/Hero.tsx Add Hero.ButtonGroup slot + deprecate legacy actions.
packages/react/src/Hero/sub-components/HeroButtonGroup.tsx New wrapper component around ButtonGroup for Hero actions.
packages/react/src/Hero/sub-components/index.ts Export HeroButtonGroup subcomponent.
packages/react/src/Hero/Hero.module.css Adjust Hero actions flex behavior for mixed children.
packages/react/src/Hero/Hero.test.tsx Add unit coverage for Hero.ButtonGroup with ActionMenu.
packages/react/src/Hero/Hero.visual.spec.ts Update/add visual stories for legacy actions + ActionMenu.
packages/react/src/Hero/Hero.stories.tsx Migrate default story to Hero.ButtonGroup.
packages/react/src/Hero/Hero.features.stories.tsx Migrate feature stories; add ActionMenu example.
packages/react/src/Hero/Hero.gridline.stories.tsx Migrate gridline stories to Hero.ButtonGroup.
packages/react/src/Hero/Hero.images-videos.stories.tsx Migrate image/video stories to Hero.ButtonGroup.
packages/react/src/Hero/Hero.examples.stories.tsx Update examples; refresh Hero+Cards fixture and add tokens.
packages/react/src/Hero/Hero.stories.module.css Remove Hero+Cards story-only CSS variables.
packages/react/src/Hero/Hero.stories.module.css.d.ts Remove generated typing for removed class.
packages/react/src/Hero/Hero.figma.tsx Update Figma-connected code generation to new actions API.
packages/react/src/CTABanner/CTABanner.features.stories.tsx Add CTABanner story demonstrating ActionMenu in ButtonGroup.
packages/react/src/CTABanner/CTABanner.visual.spec.ts Add visual coverage for CTABanner + ActionMenu story.
packages/react/src/ActionMenu/ActionMenu.tsx Replace barrel import with direct imports (Button/Text/ThemeProvider).
packages/mcp/src/test-utils/catalog.ts Update catalog snippets/subcomponents list for Hero.ButtonGroup.
apps/next-docs/content/getting-started/index.mdx Update getting started snippet to Hero.ButtonGroup + Button.
apps/next-docs/content/components/Hero/react.mdx Document Hero.ButtonGroup, ActionMenu usage, and deprecations.
apps/next-docs/content/components/ButtonGroup/react.mdx Document ActionMenu support in ButtonGroup.
.changeset/soft-banners-sparkle.md Note ButtonGroup ActionMenu support in release notes.
.changeset/hero-button-group.md Add changeset for Hero.ButtonGroup + deprecation guidance.

Review details

  • Files reviewed: 26/33 changed files
  • Comments generated: 2
  • Review effort level: Low

Comment thread packages/react/src/ButtonGroup/ButtonGroup.tsx Outdated
Comment thread .changeset/hero-button-group.md Outdated
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

🟢 No visual differences found

Our visual comparison tests did not find any differences in the UI.

Comment thread packages/mcp/scripts/generate-catalog.mjs Fixed
@rezrah rezrah changed the title Add ActionMenu to Hero and ButtonGroup changes Hero batch updates: Add ActionMenu to Hero and ButtonGroup changes, full-bleed media and more Jul 27, 2026
@rezrah
rezrah requested a review from danielguillan July 27, 2026 15:00
@rezrah
rezrah merged commit 6288e69 into main Jul 28, 2026
17 checks passed
@rezrah
rezrah deleted the rezrah/add-native-actionmenu-hero branch July 28, 2026 08:55
@primer primer Bot mentioned this pull request Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants