Skip to content

[@mantine/core] Drawer/Modal: Add Footer components#9077

Open
saadpocalypse wants to merge 1 commit into
mantinedev:masterfrom
saadpocalypse:feat/drawer-modal-footer
Open

[@mantine/core] Drawer/Modal: Add Footer components#9077
saadpocalypse wants to merge 1 commit into
mantinedev:masterfrom
saadpocalypse:feat/drawer-modal-footer

Conversation

@saadpocalypse

@saadpocalypse saadpocalypse commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Problem

Users currently struggle to implement fixed footer content (such as action buttons) at the bottom of a Drawer or Modal when the main body content (Drawer.Body / Modal.Body) is scrollable.
Common workarounds (like reusing <Drawer.Header bottom={0}>Footer</Drawer.Header> or using custom absolutely positioned containers) are hacky, break HTML semantics (using a <header> tag for a footer), and require manual layout overrides that conflict with style rules. There was no native support for a sticky footer layout.

Solution

  • Introduced ModalBaseFooter in packages/@mantine/core/src/components/ModalBase rendering a semantic <footer> element.
  • Added a .footer CSS class to ModalBase.module.css with sticky positioning (position: sticky; bottom: 0;), background color support, and standard padding spacing.
  • Created and registered the Drawer.Footer component using ModalBaseFooter with support for Drawer styles API.
  • Created and registered the Modal.Footer component using ModalBaseFooter with bottom corner border-radius variables (border-end-start-radius / border-end-end-radius) configured in Modal.module.css.
  • Documented the footer selector inside the Drawer and Modal styles API definitions.
  • Added WithFooter story test cases in both Drawer.story.tsx and Modal.story.tsx for easy manual verification.

Tests

  • Automated tests: Ran npm run jest packages/@mantine/core/src/components/Drawer/Drawer.test.tsx packages/@mantine/core/src/components/Modal/Modal.test.tsx — 556 tests passed successfully.
  • Build, typecheck & formatting: Verified clean output for npm run typecheck, npm run build, npm run oxlint, and npm run stylelint.
  • Manual verification: Checked Storybook → Drawer → With Footer and Storybook → Modal → With Footer.

Resolves #4540 and #8680

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant