2

I am using the react-scrollbar library which contains demos here.

I am trying to figure out how to increase the size of the scrollbar but am having difficulties

import React, { Component } from 'react';
import { Scrollbars } from 'react-custom-scrollbars';

export default class App extends Component {
    render() {
        return (
            <Scrollbars
                style={{ width: 300 }}>
                <p>Lorem ipsum dolor justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
                <p>Lorem consetetur</p>
                <p>Lorem ipsum anctus est Lorem ipsum dolor sit amet.</p>
            </Scrollbars>
        );
    }
}

width here changes the width of the actually div and not the scrollbar.

Does anyone know how to increase the width of the actual scrollbar?

2 Answers 2

2

You need to use renderThumbVertical

<Scrollbars
    renderThumbVertical={({ style, ...props }) =>
        <div {...props} style={{ ...style, width: '60px' }}/>
}>

 <p>Content</p>

</Scrollbars>
Sign up to request clarification or add additional context in comments.

Comments

0

If it happen that you couldn't make it work !

Then know that you need to provide the base styling. Check my answer here https://stackoverflow.com/a/54973078/7668448

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.