All Projects → yairEO → Fakescroll

yairEO / Fakescroll

Licence: agpl-3.0
vanilla-js lightweight custom HTML scrollbar

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Fakescroll

Scrollprogress
🛸 Light weight library to observe the viewport scroll position
Stars: ✭ 148 (-52.1%)
Mutual labels:  component, scrollbar
Vuescroll
A customizable scrollbar plugin based on vue.js for PC , mobile phone, touch screen, laptop.
Stars: ✭ 1,016 (+228.8%)
Mutual labels:  component, scrollbar
React Scrollbars Custom
The best React custom scrollbars component
Stars: ✭ 576 (+86.41%)
Mutual labels:  component, scrollbar
V Bar
The virtual responsive crossbrowser scrollbar component for VueJS 2x
Stars: ✭ 216 (-30.1%)
Mutual labels:  component, scrollbar
Dotenv
Symfony Dotenv parses .env files to make environment variables stored in them accessible via getenv(), $_ENV, or $_SERVER.
Stars: ✭ 3,268 (+957.61%)
Mutual labels:  component
Rome
📆 Customizable date (and time) picker. Opt-in UI, no jQuery!
Stars: ✭ 2,901 (+838.83%)
Mutual labels:  component
Paper Switch
🎚 RAMPaperSwitch is a Swift material design UI module which paints over the parent view when the switch is turned on. iOS library by @Ramotion
Stars: ✭ 2,902 (+839.16%)
Mutual labels:  component
Vue Ydui
A mobile components Library with Vue2.js. 一只基于Vue2.x的移动端组件库。
Stars: ✭ 2,798 (+805.5%)
Mutual labels:  component
Aframe Environment Component
🌄 Infinite background environments for A-Frame in a line of HTML.
Stars: ✭ 300 (-2.91%)
Mutual labels:  component
Paper Onboarding
PaperOnboarding is a material design UI slider. Swift UI library by @Ramotion
Stars: ✭ 3,147 (+918.45%)
Mutual labels:  component
Mint Ui
Mobile UI elements for Vue.js
Stars: ✭ 16,471 (+5230.42%)
Mutual labels:  component
Vue Context Menu
🗃️ Vue 2.x 右键菜单组件,菜单内容可以随意自定义
Stars: ✭ 279 (-9.71%)
Mutual labels:  component
Fmxcomponents
Firemonkey Opensource Components
Stars: ✭ 288 (-6.8%)
Mutual labels:  component
React Native Image View
Modal component to view images with zoom
Stars: ✭ 273 (-11.65%)
Mutual labels:  component
Lock
Creates and manages locks, a mechanism to provide exclusive access to a shared resource.
Stars: ✭ 299 (-3.24%)
Mutual labels:  component
Uieffect
UIEffect is an effect component for uGUI element in Unity. Let's decorate your UI with effects!
Stars: ✭ 3,449 (+1016.18%)
Mutual labels:  component
React Modern Library Boilerplate
Boilerplate for publishing modern React modules with Rollup
Stars: ✭ 285 (-7.77%)
Mutual labels:  component
React Tabulator
React Tabulator is based on tabulator - a JS table library with many advanced features.
Stars: ✭ 295 (-4.53%)
Mutual labels:  component
Vuewordcloud
Generates a cloud out of the words.
Stars: ✭ 284 (-8.09%)
Mutual labels:  component
Vue Datepicker Local
A Beautiful Datepicker Component For Vue2
Stars: ✭ 282 (-8.74%)
Mutual labels:  component



FakeScrolllightweight custom-looking scrollbars

  • 1.4KB gzipped (js)
  • 4.0KB minified (js)
  • 7.7KB unminified (js)
  • ~20+ KB avarage similar scripts (unminified)

Currently only supports vertical scroll due to cultural norms

While there is somewhat of a support for scrollbar customization through CSS, it is not fully supported in all browsers / older versions and the level of customization isn't flexible enough to allow creativity or certain special product needs.

👉 Make sure to import fakescroll.css

React port

import FakeScroll from "@yaireo/fakescroll/react.fakescroll.js"
import "@yaireo/fakescroll/fakescroll.css"

<FakeScroll className="foo" track="smooth">
    ...
</FakeScroll>

Example markup:

<div class="foo">
    ...
    ...
    ...
</div>

Initialize custom scrollbar:

document.querySelector('.foo').fakeScroll();

The above markup will now become:

<div class="foo fakeScroll fakeScroll--hasBar">
    <div class="fakeScroll__wrap">
        <div class="fakeScroll__content">
            ...
            ...
            ...
        </div>
    </div>
    <div class="fakeScroll__bar"></div>
</div>

Browser support

The script probably won't work on IE without Babel & ES2015 polyfills.

DEMO PAGE

Settings

Name Type Default Info
classname String "" Class name which is added to the scrollbar Track element
track Boolean/String false enable track events. use "smooth" for smooth "jumping"
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].