@open-norantec/ui-libraries v1.0.0-alpha.61
Scroller Coaster
A customizable, flexible, and elegant scrollbar component for React.js and Next.js.
Features
- 🎯 Support for both vertical and horizontal scrolling
- 🌐 RTL layout support
- 🎨 Fully customizable styling
- 🔄 Smooth scrolling experience
- ⚡ High performance, no jank
- 📱 Responsive design
Installation
npm install scroller-coasterBasic Usage
import { ScrollerCoaster } from 'scroller-coaster';
const App = () => {
return (
<ScrollerCoaster
style={{
width: '400px',
height: '300px',
border: '1px solid #ccc'
}}
>
{/* Your content */}
</ScrollerCoaster>
);
};API
ScrollerCoaster Props
| Property | Type | Default | Description |
|---|---|---|---|
| draggingScrollMaximumSpeed | number | 15 | Maximum speed of scroll when dragging (px/frame) |
| draggingScrollThreshold | number | 50 | Threshold to trigger drag scrolling (px) |
| horizontalTrackProps | ScrollerCoasterTrackProps | - | Horizontal scrollbar track properties |
| verticalTrackProps | ScrollerCoasterTrackProps | - | Vertical scrollbar track properties |
| dir | 'rtl' | 'ltr' | 'ltr' | Text direction |
ScrollerCoasterTrackProps
| Property | Type | Default | Description |
|---|---|---|---|
| showMode | 'always' | 'hover' | 'scrolling' | 'scrolling' | Scrollbar visibility mode |
| size | number | 12 | Scrollbar size (px) |
| thumbProps | React.HTMLAttributes | - | Scrollbar thumb properties |
Examples
Custom Scrollbar Styling
<ScrollerCoaster
horizontalTrackProps={{
showMode: 'always',
size: 8,
thumbProps: {
style: {
backgroundColor: '#6366f1',
borderRadius: '4px'
}
}
}}
verticalTrackProps={{
showMode: 'hover',
size: 8,
thumbProps: {
style: {
backgroundColor: '#6366f1',
borderRadius: '4px'
}
}
}}
>
{/* Content */}
</ScrollerCoaster>RTL Support
<ScrollerCoaster
dir="rtl"
style={{
width: '400px',
height: '300px'
}}
>
{/* RTL content */}
</ScrollerCoaster>Browser Support
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
Development
# Install dependencies
npm install
# Run development environment
npm run demo
# Build library
npm run build:lib
# Build demo
npm run build:demoLicense
MIT
Contributing
- Fork the project
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
9 months ago
9 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago