2.3.3 • Published 6 years ago

angular-io-slimscroll-2 v2.3.3

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

angular-io-slimScroll

Customizable slimScroll directive for Angular 2.

Code Example

Demo

You'll need to add SlimScroll to your application module.

import { SlimScroll } from 'angular-io-slimscroll';

@NgModule({
  declarations: [
    SlimScroll,
    AppComponent
  ],
  imports: [
    ...
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}

And then add slimScroll attribute with options to your element:

<div slimScroll
     width="auto"
     height="250px"
     size="7px">
    Lorem ipsum dolor sit amet...   
 </div>

Motivation

Existing slimScrolls do not work as they should... So we have written another one 😏

Installation

npm i angular-io-slimscroll --save

API Reference

Options can be passed to an element via html attributes:

PropertyTypeDefaultDescription
widthstringautoWidth in pixels of the visible scroll area
heightstring250pxHeight in pixels of the visible scroll area
sizestring7pxWidth in pixels of the scrollbar and rail
colorstring#000Scrollbar color, accepts any hex/color value
positionstringrightScrollbar position - left/right
distancestring1pxDistance in pixels between the side edge and the scrollbar
startstringtopDefault scroll position on load - top / bottom
opacitynumber.4Sets scrollbar opacity
transitionnumber.3Set transition for opacity in seconds
alwaysVisiblebooleanfalseEnables always-on mode for the scrollbar
disableFadeOutbooleanfalseCheck if we should hide the scrollbar when user is hovering over
railVisiblebooleanfalseSets visibility of the rail
railColorstring#333Sets rail color
railOpacitynumber.2Sets rail opacity
railClassstringslimScrollRailDefautlt CSS class of the slimscroll rail
barClassstringslimScrollBarDefautlt CSS class of the slimscroll bar
wrapperClassstringslimScrollDivDefautlt CSS class of the slimscroll wrapper
allowPageScrollbooleanfalseCheck if mousewheel should scroll the window if we reach top/bottom
wheelStepnumber20Scroll amount applied to each mouse wheel step
touchScrollStepnumber200Scroll amount when user is using gestures
borderRadiusstring7pxSets border radius
railBorderRadiusstring7pxSets border radius of the rail
scrollTonumber0Set default point from which to start scrolling
autoScrollToBottombooleanfalseScroll to bottom on adding new content to container
maxHeightBeforeEnablebooleanundefinedEnable Slimscroll if content reach this limit

License

This project is licensed under the MIT license. See the LICENSE file for more info.