How can i animate show/hide scrollbar #1472
-
<ScrollAreaPrimitive.Scrollbar className="scroll-scrollbar" orientation="vertical">
<ScrollAreaPrimitive.Thumb className="scroll-thumb" />
</ScrollAreaPrimitive.Scrollbar> |
Beta Was this translation helpful? Give feedback.
Answered by
benoitgrelard
Jun 15, 2022
Replies: 1 comment 1 reply
-
Hey @polRk, You can use the '&[data-state="visible"]': {
animation: `${fadeIn} 300ms ease-out`,
},
'&[data-state="hidden"]': {
animation: `${fadeOut} 300ms ease-out`,
}, Here's a demo where I've added a fadeIn/fadeOut animation to the basic demo from our website: https://codesandbox.io/s/scrollarea-animated-scrollbar-7eu1y3 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
polRk
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @polRk,
You can use the
data-state
(visible
orhidden
) on the scrollbar to add animations like so:Here's a demo where I've added a fadeIn/fadeOut animation to the basic demo from our website: https://codesandbox.io/s/scrollarea-animated-scrollbar-7eu1y3