Skip to content

feat(components): Add sticky variation to Modal Actions and Header#3027

Open
taylorvnoj wants to merge 9 commits intomasterfrom
TAYLOR/sticky-modal-bits
Open

feat(components): Add sticky variation to Modal Actions and Header#3027
taylorvnoj wants to merge 9 commits intomasterfrom
TAYLOR/sticky-modal-bits

Conversation

@taylorvnoj
Copy link
Copy Markdown
Contributor

@taylorvnoj taylorvnoj commented Mar 31, 2026

Motivations

Add sticky header/actions variants to composable Modals so long content scrolls in the middle while key controls stay visible, without changing default behaviour.

Changes

Added

  • variant="sticky" | "inline" (default) support on Modal.Header and Modal.Actions
  • Visual test cases and snapshots for sticky header/actions/regions

When sticky is enabled:
Header and actions are extracted from the scrollable body
The modal switches to a flex column layout
Only the modal body scrolls, while header and actions remain fixed

This avoids issues with position: sticky (e.g. content appearing underneath the footer) and results in more predictable layout and visual behaviour.

NOTE: The implementation relies on identifying ModalHeader / ModalActions directly (no wrapper support), which reflects current usage patterns in production. If we decide we want to support that, we can iterate on this foundation.

Changed

  • Composable Modal layout now separates sticky regions from the scrollable body when variants are used
  • Modal stories updated to demonstrate sticky header/actions
  • Visual test page updated with new sticky region examples

Testing

  • test the variations in the "Sticky Regions" story (header only, actions only, both)
    • when Header is sticky, it stays fixed at the top
    • when Actions are sticky they stay fixed at the bottom
    • only middle content scrolls
  • put variant="sticky" in the header of "Modal With Provider Example" story to check that tabbing through content is still behaving as normal
Screen.Recording.2026-03-31.at.7.29.27.AM.mov

In Atlantis we use Github's built in pull request reviews.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 31, 2026

Deploying atlantis with  Cloudflare Pages  Cloudflare Pages

Latest commit: 22f2e82
Status: ✅  Deploy successful!
Preview URL: https://ef2b888f.atlantis.pages.dev
Branch Preview URL: https://taylor-sticky-modal-bits.atlantis.pages.dev

View logs

@taylorvnoj taylorvnoj self-assigned this Mar 31, 2026
@taylorvnoj taylorvnoj marked this pull request as ready for review March 31, 2026 18:00
@taylorvnoj taylorvnoj requested a review from a team as a code owner March 31, 2026 18:00
@edison-cy-yang
Copy link
Copy Markdown
Contributor

edison-cy-yang commented Apr 1, 2026

@AutumnDaweBaillie Do you think we should add some padding top to Modal.Actions now that content is scrollable?
Screenshot 2026-04-01 at 12 42 56 PM

Also, I'm thinking we need box-shadow to the sticky header and actions to indicate overflow when content scrolls behind them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants