1.0.1 • Published 4 months ago
common-react-scrollbar v1.0.1
Common React Scrollbar Component
Description
A common React scrollbar component that supports both vertical and horizontal scrollbars.
Props
children
(React.ReactNode): The content inside the scrollbar.height
(number): The height of the scrollbar container.width
(number): The width of the scrollbar container.dir
('rtl' | 'ltr'): The direction of the scrollbar. Default is 'ltr'. Compatible with right-to-left languages like Arabic and Hebrew.
Example
import React from 'react';
import { Scrollbar } from './Scrollbar';
import 'common-react-scrollbar/dist/index.css';
const App = () => {
return (
<Scrollbar height={300} width={300}>
<div style={{ height: '600px', width: '600px' }}>
This is the scrollable content
</div>
</Scrollbar>
);
};
export default App;
Installation
npm install common-react-scrollbar
Usage
import React from 'react';
import { Scrollbar } from 'common-react-scrollbar';
import 'common-react-scrollbar/dist/index.css';
const App = () => {
return (
<Scrollbar height={300} width={300}>
<div style={{ height: '600px', width: '600px' }}>
This is the scrollable content
</div>
</Scrollbar>
);
};
export default App;
License
MIT
1.0.1
4 months ago
1.0.1-beta.1
4 months ago
1.0.1-beta
4 months ago
1.0.0
5 months ago
0.0.2
5 months ago
0.0.1
5 months ago