Skip to content

AnchoredOverlay: Add support for CSS anchor positioning - #7604

Merged
siddharthkp merged 87 commits into
mainfrom
tylerjdev/css-anchor-positioning
Mar 11, 2026
Merged

AnchoredOverlay: Add support for CSS anchor positioning#7604
siddharthkp merged 87 commits into
mainfrom
tylerjdev/css-anchor-positioning

Conversation

@TylerJDev

@TylerJDevTylerJDev commented Feb 26, 2026

Copy link
Copy Markdown
Member

The first batch of work to add CSS anchor positioning to overlay components.

Example of CSS anchor positioning:

Screen.Recording.2026-03-04.at.7.33.32.AM.mov
Video description

In the video, we show the `AnchoredOverlay` opening and being positioned directly under the trigger. We then show off the overlay repositioning when there's lack of space.

Changelog

New

  • Added support for CSS Anchor Positioning in AnchoredOverlay, gated by the primer_react_css_anchor_positioning feature flag.
  • Updated ActionMenu to ensure that the anchor button receives the correct anchor class for CSS anchor positioning, and improved merging of class names between anchor and button props.
  • Added new stories to AnchoredOverlay.features.stories.tsx to demonstrate anchor positioning in various layouts, including centered overlays, grid layouts, within dialogs (including nested and overflowing dialogs), scroll containers, and sticky headers.

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

@changeset-bot

changeset-botBot commented Feb 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1364a4d

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

This PR includes changesets to release 1 package
NameType
@primer/reactMinor

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-actionsgithub-actionsBot added staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Feb 26, 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. Or, apply the integration-tests: skipped manually label to skip these checks.

@primer

primerBot commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

🤖 Lint and formatting issues have been automatically fixed and committed to this PR.

@github-actions
github-actionsBottemporarily deployed to storybook-preview-7604 February 26, 2026 22:32 Inactive
@primer

primerBot commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

🤖 Lint issues have been automatically fixed and committed to this PR.

@primer

primerBot commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

🤖 Lint issues have been automatically fixed and committed to this PR.

@primer

primerBot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

🤖 Lint and formatting issues have been automatically fixed and committed to this PR.

@github-actions
github-actionsBottemporarily deployed to storybook-preview-7604 February 27, 2026 02:10 Inactive
@primer

primerBot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

🤖 Lint issues have been automatically fixed and committed to this PR.

@primer

primerBot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

🤖 Lint issues have been automatically fixed and committed to this PR.

@siddharthkpsiddharthkp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I added e2e tests to compare this PR against: diff.

The diffs are only present with the feature flag ON. So that's good! Even though this feature isn't perfect yet, we can merge and continue to iterate on it.

Regressed:

AnchoredOverlay-Anchor-Alignment: default is not centered anymore.

image

AnchoredOverlay-Scroll-With-Anchor: default is not centered anymore

image

AnchoredOverlay-Fullscreen-Variant: Not fullscreen anymore

image

AnchoredOverlay-Offset-Alignment-From-Anchor: offset not respected

image

AnchoredOverlay-Offset-Position-From-Anchor: offset not respected

image

@primer-integration

Copy link
Copy Markdown

👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/15793

@primer-integration

Copy link
Copy Markdown

Integration test results from github/github-ui:

Passed CI  Passed
Passed VRT  Passed
Waiting Projects   Waiting

@siddharthkp

Copy link
Copy Markdown
Member

Added integration-tests: skipped manually because tests are passing in the integration branch, but it wasn't reported fully: https://github.com/github/github-ui/pull/15793#issuecomment-4042824514

@primerprimerBot mentioned this pull request Mar 11, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommendedThis change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpmintegration-tests: skipped manuallyChanges in this PR do not require an integration teststaffAuthor is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@TylerJDev@siddharthkp@francinelucca