Make Transition on Tabs. #1301
Replies: 7 comments 3 replies
-
Same question! I was trying to use the Transition components with the Tab.Panels to crossfade the tab content, but haven't figure it out yet. |
Beta Was this translation helpful? Give feedback.
-
Same question here! It seems I can not directly pass the |
Beta Was this translation helpful? Give feedback.
-
I came up with a basic functioning tab cross fade effect. I am very new to Headless and React in general so I am not entirely sure if this is working as intended or not. I originally tried to apply the effect to the tab panel itself - that doesn't work... you get the fade effect and then the content disappears again. Putting the Transition inside the tab panel as shown below seems to work fine (I made the duration purposely long to demonstrate. This is an example page I made with Next.js/typescript.
|
Beta Was this translation helpful? Give feedback.
-
You can set |
Beta Was this translation helpful? Give feedback.
-
more detailed and styled one:
|
Beta Was this translation helpful? Give feedback.
-
Hi! Both examples above aren't transitioning for me. I tried them on a fresh install. Any ideas? |
Beta Was this translation helpful? Give feedback.
-
If all you want is an entrance transition and are okay with the animation running on page load, then you don't even need to use the Transition component. Just add some CSS: // tailwind.config.ts
const config: Config = {
theme: {
extend: {
animation: {
"fade-in-grow": "fade-in 300ms, grow 300ms",
},
keyframes: {
"grow": {
"from": {
"transform": "scale(0.75)",
},
"to": {
"transform": "scale(1)",
},
},
"fade-in": {
"from": {
"opacity": "0",
},
"to": {
"opacity": "1",
},
},
},
}
}
} Then you can just add a single class: <Tab.Panel className="animate-fade-in-grow">
...
</Tab.Panel> |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, Thanks for great project!
I have some problem to make tab panel transition, how it works?
So every tab clicked, it show text on tab panel using transition.
Thanks for help!
Beta Was this translation helpful? Give feedback.
All reactions