npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

baron

v3.0.3

Published

A small, fast and crossbrowser custom scrollbar with native system scroll mechanic.

Downloads

32,812

Readme

Build Status Join the chat at https://gitter.im/Diokuz/baron

You cannot change the world, but you can change a scrollbar!

Baron — a small, fast and crossbrowser custom scrollbar with native system scroll mechanic.

See also react-baron.

Demo

API

Skins

Features

  • Doesn't replace native system scroll mechanic.
  • Customizable scrollbar design with full CSS support.
  • Do not depends on external libraries (since v3).
  • Can be inited on hidden blocks
  • Vertical, horizontal and bidirectional scroll
  • Infinite scroll
  • Nested scrollers

Baron do not hide native scrollbar, just hides it. This guarantees scrolling will work in any browser.

1. Hiding system scrollbar

  • Include baron.js and some css:
<script src="baron.js"></script>
<style>
    ::-webkit-scrollbar { /* for Mac OS X support */
        width: 0;
    }
</style>
  • Initialize baron on your scroller:
baron('.my-scroller');

2. Making your own custom-designed scrollbar

You can do everything you want with CSS of your custom scrollbar. There are some required and recommended css rules (see base css) – do not forget to use them. You can also use predefined skins.

Webpack

Just import baron and use it:

import baron from 'baron';
// or: const baron = require('baron');

baron({ scroller: ... });

Version for development

Note, that baron.js is a development version. It contains additional code and log messages, to make the development process easier.

baron.min.js is a production-ready version: weight less, works a little bit faster.

Nested scrollers

Baron do support nested scrollers. To make scrollers happy, follow the rule:

  • Initialize baron instances from ancestor to descendant scrollers order.

Third World War will not begun if you break that rule, but there may be some bad user-experience with baron-instances updates (when size of one scroller depends on size of another). See /demo source.

Browsers support

Baron uses two old CSS 2.1 technologies: 1) overflow: scroll 2) overflow: hidden.

| | | | | | | |:---:|:---:|:---:|:---:|:---:|:---:| | 8+ ✔ | 3.6+ ✔ | 10+ ✔ | 11.5+ ✔ | 5.1+ ✔ | 4+ ✔ |

Wanna support ie6 and Opera 9? Try baron@2 version + jQuery. Version 3+ uses classList API and style attribute.

3.0 migration

  1. Make sure you are satisfied with new supported browser list.
  2. Remove $ and event params if any. You also could remove jQuery from your page.
  3. Make sure you have one html node per one initialization: multi-baron not supported.
  4. pull plugin removed, so you cannot use it anymore. But you can add it manually.

2.0 migration

impact param default value changed to scroller for all directions. That impact horizontal scrollbars.

If you use % cross-paddings (padding-left and padding-right for vertical direction) for scroller, it will be buggy in Mac OS X Firefox because of need for extra-padding to support it. Use pixels instead, or make html-container inside scroller.

Also, checkout changelog.

1.0 migration

If you have any problems, just set cssGuru option to true.

Chaining

Horizontal and bidirectional scroll

Plugins

License

MIT.