You can fully customize the HTML structure, class names, or tag names by passing a custom renderer (a Stateless Functional Component) to various props.
Important: The renderer receives a props object containing an elementRef function. You must call this function with the DOM element's reference as the first parameter and spread the remaining restProps onto the element to ensure the component functions correctly.
<Scrollbar
renderer={(props) => {
const { elementRef, ...restProps } = props;
return <span {...restProps} ref={elementRef} className="MyAwesomeScrollbarsHolder" />;
}}
wrapperProps={{
renderer: (props) => {
const { elementRef, ...restProps } = props;
return <span {...restProps} ref={elementRef} className="MyAwesomeScrollbarsWrapper" />;
},
}}
scrollerProps={{
renderer: (props) => {
const { elementRef, ...restProps } = props;
return <span {...restProps} ref={elementRef} className="MyAwesomeScrollbarsScroller" />;
},
}}
contentProps={{
renderer: (props) => {
const { elementRef, ...restProps } = props;
return <span {...restProps} ref={elementRef} className="Content" />;
},
}}
trackXProps={{
renderer: (props) => {
const { elementRef, ...restProps } = props;
return <span {...restProps} ref={elementRef} className="TrackX" />;
},
}}
trackYProps={{
renderer: (props) => {
const { elementRef, ...restProps } = props;
return <span {...restProps} ref={elementRef} className="trackY" />;
},
}}
thumbXProps={{
renderer: (props) => {
const { elementRef, ...restProps } = props;
return <span {...restProps} ref={elementRef} className="ThUmBX" />;
},
}}
thumbYProps={{
renderer: (props) => {
const { elementRef, ...restProps } = props;
return <span {...restProps} ref={elementRef} className="tHuMbY" />;
},
}}
/>