# react-magic-slider-dots

> React Magic Slider Dots Component for React Slick Carousel. Inspired by Instagram.

Latest version **1.2.2** (published 2020-07-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-magic-slider-dots
pnpm add react-magic-slider-dots
yarn add react-magic-slider-dots
bun add react-magic-slider-dots
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2020-07-01 |
| First published | 2018-08-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=8 |
| Dependencies | 0 |
| Unpacked size | 65.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 27 |
| Author | patricktran |
| Maintainers | patricktran |
| Keywords | react, react-component, react slick, carousel, slick carousel, instagram gallery, carousel navigation, carousel dots, image slider dots |

## Links

- npm: https://www.npmjs.com/package/react-magic-slider-dots
- Repository: https://github.com/patricktran/react-magic-slider-dots
- Homepage: https://github.com/patricktran/react-magic-slider-dots#readme
- Issues: https://github.com/patricktran/react-magic-slider-dots/issues
- npm.io page: https://npm.io/package/react-magic-slider-dots

## 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

- 1.2.2 (latest) — 2020-07-01
- 1.2.0-beta.0 (next) — 2019-09-13
- 1.2.1 — 2020-05-16
- 1.2.0 — 2020-03-24
- 1.1.3 — 2019-07-03
- 1.1.2 — 2018-09-23
- 1.1.1 — 2018-08-10
- 1.1.0 — 2018-08-10
- 1.0.1 — 2018-08-07
- 1.0.0 — 2018-08-07

## README

# react-magic-slider-dots

> React Magic Slider Dots Component for React Slick Carousel

##### _Inspired by Instagram_

[![NPM](https://img.shields.io/npm/v/react-magic-slider-dots.svg)](https://www.npmjs.com/package/react-magic-slider-dots) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

![screenshot](/magic-slider-dots-screenshot.png?raw=true)

## Install

```bash
npm install --save react-magic-slider-dots
```

⚠️ Also install react-slick and slick-carousel for css and font [React Slick Documentation](https://github.com/akiran/react-slick)

```bash
npm install slick-carousel
npm install react-slick --save
import "slick-carousel/slick/slick.css";
import "slick-carousel/slick/slick-theme.css";
```

## [DEMO](https://patricktran.github.io/react-magic-slider-dots/)

## Usage

```jsx
import React, { Component } from 'react';
import Slider from 'react-slick';
import 'slick-carousel/slick/slick.css';
import 'slick-carousel/slick/slick-theme.css';

import MagicSliderDots from 'react-magic-slider-dots';
import 'react-magic-slider-dots/dist/magic-dots.css';

class App extends Component {
  render() {
    const settings = {
      dots: true,
      arrows: true,
      infinite: false,
      speed: 500,
      slidesToShow: 1,
      slidesToScroll: 1,
      appendDots: dots => {
        return <MagicSliderDots dots={dots} numDotsToShow={4} dotWidth={30} />;
      }
    };

    return (
      <Slider {...settings}>
        <div>
          <h3>1</h3>
        </div>
        <div>
          <h3>2</h3>
        </div>
        <div>
          <h3>3</h3>
        </div>
        <div>
          <h3>4</h3>
        </div>
        <div>
          <h3>5</h3>
        </div>
        <div>
          <h3>6</h3>
        </div>
        <div>
          <h3>7</h3>
        </div>
        <div>
          <h3>8</h3>
        </div>
      </Slider>
    );
  }
}
```

### API

This a list of props that you can pass down to the component:

| Property                | Description                                                      | Default value           | Type   | Required |
| ----------------------- | ---------------------------------------------------------------- | ----------------------- | ------ | -------- |
| `dots`                  | array of HTML li elements representing the slider dot            |                         | array  | yes      |
| `numDotsToShow`         | number of slider dots to show                                    |                         | number | yes      |
| `dotWidth`              | width, in pixels, of a slider dot including any margins/padding  |                         | number | yes      |
| `dotContainerClassName` | class name of parent div                                         | `magic-dots slick-dots` | string |
| `activeDotClassName`    | class name of active slider dot                                  | `slick-active`          | string |
| `prevNextDotClassName`  | class name of left-most (prev) and right-most (next) slider dot. | `small`                 | string |

## License

MIT © [patricktran](https://github.com/patricktran)

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