-
Notifications
You must be signed in to change notification settings - Fork 576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to show the scrollbar when you hover over the container. #415
Comments
Maybe Since this package renders your scrollbar as a div, you can achieve it this way:
<Scrollbars
className='custom-scrollbar-container'
renderThumbVertical={({ style, ...props }) => (
<div {...props} className='custom-scrollbar' />
)}
>
<div className='h-16' />
<div className='transition-color h-[5000px]'>Main</div>
</Scrollbars>
.custom-scrollbar-container .custom-scrollbar {
/* Use opacity here instead of display:none for a good looking transition */
opacity: 0;
transition-property: opacity !important;
transition-duration: 0.3s !important;
}
.custom-scrollbar-container:hover .custom-scrollbar {
opacity: 100;
} You can simply right click on the scrollbar and inspect it div:has(> div.custom-scrollbar) {
width: 12px !important;
} |
Thanks for the help man!
|
Does your code look like this one? <Scrollbars
style={{
width: 500,
height: 300,
}}
renderThumbVertical={({ ...props }) => (
<div
{...props}
className='custom-scrollbar'
></div>
)}
>
<table className='custom-scrollbar-trigger'>
{/* rows go here */}
</table>
</Scrollbars> Then you should try this one .custom-scrollbar {
opacity: 0;
transition-property: opacity, color, background-color !important;
transition-duration: 0.3s !important;
}
div:has(> .custom-scrollbar-trigger:hover) ~ div > .custom-scrollbar {
opacity: 100 !important;
} |
how can i show scrollbar when i hover over container, passing css to renderTrackVertical and other such props are not working
The text was updated successfully, but these errors were encountered: