Skip to content

[tabs] Add transition attributes to <Tabs.Panel> part - #3880

Merged
atomiks merged 4 commits into
mui:masterfrom
atomiks:fix/tabs-panel-transition
Feb 2, 2026
Merged

atomiks merged 4 commits into
mui:masterfrom
atomiks:fix/tabs-panel-transition

Conversation

@atomiks

@atomiks atomiks commented Jan 27, 2026 •

Copy link
Copy Markdown
Contributor

@atomiks atomiks added component: tabs Changes related to the tabs 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. labels Jan 27, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jan 27, 2026 •

Copy link
Copy Markdown
  • base-ui-tanstack-start

  • vite-css-base-ui-example

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

commit: a2b4971

@mui-bot

mui-bot commented Jan 27, 2026 •

Copy link
Copy Markdown

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react 🔺+160B(+0.04%) 🔺+31B(+0.02%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@netlify

netlify Bot commented Jan 27, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 41ded89
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/698103b699e5840009863b5c
😎 Deploy Preview https://deploy-preview-3880--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.

@atomiks
atomiks force-pushed the fix/tabs-panel-transition branch 2 times, most recently from 773a121 to e03b923 Compare January 30, 2026 01:18
@atomiks
atomiks marked this pull request as ready for review January 30, 2026 01:43
@greptile-apps

greptile-apps Bot commented Jan 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Overview

Greptile Summary

Added transition attributes to <Tabs.Panel> to support CSS animations when panels are shown and hidden. The implementation follows the established pattern used in other Base UI components like ComboboxClear and uses the standard useTransitionStatus and useOpenChangeComplete hooks.

Key changes:

  • Added transitionStatus state tracking to enable data-starting-style and data-ending-style attributes
  • Changed panel visibility logic from hidden based on selection to mounted based on transition state
  • Added inert attribute to non-active panels for accessibility
  • Changed tabIndex from hidden ? -1 : 0 to open ? 0 : -1 for consistency
  • Updated shouldRender logic to work with mounted state instead of hidden
  • Added comprehensive Chromium tests for enter and exit animations

Confidence Score: 5/5

  • This PR is safe to merge with no issues found
  • The implementation follows established patterns in the codebase, uses the correct utility hooks, includes proper test coverage for both enter and exit animations, and all changes are logically sound
  • No files require special attention

Important Files Changed

Filename Overview
packages/react/src/tabs/panel/TabsPanel.tsx Added transition status tracking for panel enter/exit animations using useTransitionStatus and useOpenChangeComplete hooks
packages/react/src/tabs/panel/TabsPanel.test.tsx Added comprehensive animation tests for data-starting-style and data-ending-style attributes during mount/unmount

@atomiks
atomiks force-pushed the fix/tabs-panel-transition branch 3 times, most recently from 8719650 to f6c068a Compare February 1, 2026 17:49
},
];

export default function TabsAnimationsExperiment() {

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.

The current transition is really fast 😅

Can it be like a carousel? e.g. https://motion.dev/tutorials/react-smooth-tabs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah it looks bad, but I wasn't really trying to make it look nice, just a visual test to make sure it works.
I can update it, though

@atomiks
atomiks force-pushed the fix/tabs-panel-transition branch from 119efe5 to a2b4971 Compare February 2, 2026 07:11
@atomiks
atomiks merged commit 52dd939 into mui:master Feb 2, 2026
1 of 6 checks passed
@atomiks
atomiks deleted the fix/tabs-panel-transition branch February 2, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: tabs Changes related to the tabs 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.

[tabs] data-starting-style and data-ending-style not getting applied to Panel

4 participants