React-baron
react component for baron scrollbar customization support. Now jQuery-free (you dont have to have jQuery anymore).
npm i react-baron --save
example:
Baron = ; ...// All params are optional { return <Baron clipperCls="clipper" scrollerCls="scroller" trackCls="track" barCls="bar" barOnCls="baron"> ...Scrollable content here... </Baron> ;}
/* or, for flexbox */ /* And scrollbar */ /* hide default chrome scrollbar */
API
Same as baron.js.
Plus
// Scroll as far as possiblethisrefsbaron// You must set baron ref for Baron component // Get DOM-node scrollerthisrefsbaron; // Get DOM-node clipperthisrefsbaron; // onScroll handleronScroll: PropTypesfunc;
Browsers support
React-baron is jQuery-free (it has tiny jQuery-like utility, about 400 bytes), and its uses HTMLElement classList.
8+ ✔ | 3.6+ ✔ | 10+ ✔ | 11.5+ ✔ | 5.1+ ✔ | 4+ ✔ |
If you want to support IE9- (or Firefox 3.0, etc.), just set $
prop to your jQuery
instance.
<Baron $= ... />