Skip to content

Conversation

@atomiks
Copy link
Contributor

@atomiks atomiks commented Sep 12, 2025

Closes #1955

Screen.Recording.2025-09-16.at.10.25.33.am.mov

New part

Adds a new <Toast.Content> part to apply fade-out and overflow: hidden effects to, and to allow ResizeObserver to only measure content changes now that the height of the toast changes and transitions.

Styles fixes

There's a new --peek variable (user-defined in the demos) and changed transform logic that ensures the "peek" part of stacked toasts behind the front one is constant and doesn't change based on the height of the toasts. I also noticed this fixed the animation bug that was present when holding down Enter on the toast creator button.

@atomiks atomiks added type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. breaking change Introduces changes that are not backward compatible. component: toast Changes related to the toast component. labels Sep 12, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 12, 2025

vite-css-base-ui-example

pnpm add https://pkg.pr.new/mui/base-ui/@base-ui-components/react@2742
pnpm add https://pkg.pr.new/mui/base-ui/@base-ui-components/utils@2742

commit: 7fa7feb

@netlify
Copy link

netlify bot commented Sep 12, 2025

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 7fa7feb
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/68d26ce8e3749b0009d2221f
😎 Deploy Preview https://deploy-preview-2742--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mui-bot
Copy link

mui-bot commented Sep 12, 2025

Bundle size report

Bundle Parsed size Gzip size
@base-ui-components/react 🔺+465B(+0.13%) 🔺+129B(+0.11%)

Details of bundle changes

@atomiks atomiks force-pushed the feat/toast-variable-height-stacking branch 8 times, most recently from fc9094a to 952d36f Compare September 16, 2025 01:48
@atomiks atomiks marked this pull request as ready for review September 16, 2025 01:55
* Indicates the height of the frontmost toast at index 0 in the list.
* @type {number}
*/
index0Height = '--toast-index-0-height',
Copy link
Member

@aarongarciah aarongarciah Sep 22, 2025

Choose a reason for hiding this comment

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

Would frontmostHeight or foremostHeight be a better name? My brain instinctively thought there were also index-1, index-2, ... vars.

Suggested change
index0Height = '--toast-index-0-height',
frontmostHeight = '--toast-frontmost-height',

"cssVariables": {}
"cssVariables": {
"--toast-frontmost-height": {
"description": "Indicates the height of the frontmost toast at index 0 in the list.",
Copy link
Member

@aarongarciah aarongarciah Sep 22, 2025

Choose a reason for hiding this comment

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

nit: "index 0" sounds redundant with frontmost

Suggested change
"description": "Indicates the height of the frontmost toast at index 0 in the list.",
"description": "Indicates the height of the frontmost toast in the list.",

or

Suggested change
"description": "Indicates the height of the frontmost toast at index 0 in the list.",
"description": "Indicates the height of the frontmost toast.",

@atomiks atomiks force-pushed the feat/toast-variable-height-stacking branch from 298b160 to b1bd10b Compare September 23, 2025 00:13
Copy link
Member

@michaldudak michaldudak left a comment

Choose a reason for hiding this comment

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

Minor remarks only - approving.

@atomiks atomiks force-pushed the feat/toast-variable-height-stacking branch from dd8e775 to bf12feb Compare September 23, 2025 08:41
@atomiks atomiks merged commit 6cf55d3 into mui:master Sep 23, 2025
20 checks passed
@atomiks atomiks deleted the feat/toast-variable-height-stacking branch September 23, 2025 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Introduces changes that are not backward compatible. component: toast Changes related to the toast component. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[toast] Support stacking toasts of differing heights

4 participants