# sbweb-dragband

> UI library to create a draggable list bar. Reponsive, scrollable, swipeable

Latest version **0.2.6** (published 2018-11-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install sbweb-dragband
pnpm add sbweb-dragband
yarn add sbweb-dragband
bun add sbweb-dragband
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.6 |
| Published | 2018-11-24 |
| First published | 2018-09-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 42.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | S. Derdeyn |
| Maintainers | sigged |
| Keywords | scroll, drag, swipe, list, items, responsive, mobile |

## Links

- npm: https://www.npmjs.com/package/sbweb-dragband
- Repository: https://github.com/sigged/sbweb-dragband
- Issues: https://github.com/sigged/sbweb-dragband/issues
- npm.io page: https://npm.io/package/sbweb-dragband

## Alternatives

- [adhdev](https://npm.io/package/adhdev.md) — 11.1K weekly downloads
- [react-slide-button](https://npm.io/package/react-slide-button.md) — 310 weekly downloads
- [better](https://npm.io/package/better.md) — 42 weekly downloads
- [react-native-swipe-image](https://npm.io/package/react-native-swipe-image.md) — 22 weekly downloads
- [nl.fokkezb.pulltorefresh](https://npm.io/package/nl.fokkezb.pulltorefresh.md) — 11 weekly downloads

## Recent versions

- 0.2.6 (latest) — 2018-11-24
- 0.2.5 — 2018-09-21
- 0.2.4 — 2018-09-16
- 0.2.3 — 2018-09-16
- 0.2.2 — 2018-09-15
- 0.2.1 — 2018-09-15
- 0.2.0 — 2018-09-15
- 0.1.1 — 2018-09-15
- 0.1.0 — 2018-09-14

## README

# DragBand #

UI library to create a draggable list bar
 - Native javascript
 - Responsive
 - Supports swiping

## Usage #

```js
// create a dragBar with itemindex 11 selected by default
var myDragBand = dragBand.init(
    document.querySelector('#myul'), 11, {
        leftScroller : document.getElementById('left-scroll-button'),
        rightscroller : document.getElementById('right-scroll-button'),
        scrollstep : 50,
        elasticWidth : 100,
        hideScrollerMargin : 20
    });

// select no item
myDragBand.selectItem(null);

// select item with index 2
myDragBand.selectItem(2);


// create object with default options and no scrollbuttons
var simpleDragBand = dragBand.init(document.querySelector('#simple'));
```

## Options

Configure the third parameter of `init` method as an object with the following properties:

| Property                | Type    |  Description                              | default |
|:------------------------|:-------:|:------------------------------------------| :------:|
| `leftScroller`          | Object  | element representing left scrollbutton    | `null`  |
| `rightscroller`         | Object  | element representing right scrollbutton   | `null`  |
| `scrollstep`            | number  | px to scroll when using wheel/scrollbutton| `50`    |
| `elasticWidth`          | number  | elasticity beyond left/right edges in px  | `100`   |
| `hideScrollerMargin` | number  | hidden buttons when with margin from edge | `20`    |

## Example #

Check https://codepen.io/anon/pen/vzaaoL for an example.

---
_Source: https://npm.io/package/sbweb-dragband · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
