Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/shredderming/erizabesu

Carousel component built with Preact
https://github.com/shredderming/erizabesu

carousel preact preact-components

Last synced: 11 days ago
JSON representation

Carousel component built with Preact

Awesome Lists containing this project

README

        


erizabesu



Erizabesu(エリザベス)
npm prettier


Carousel component built with Preact.

---

## Install

**npm**

```sh
npm install erizabesu
npm install erizabesu-indicators # optional
npm install erizabesu-arrows # optional
```

**yarn**

```sh
yarn add erizabesu
yarn add erizabesu-indicators # optional
yarn add erizabesu-arrows # optional
```

## Demos

- [**Simple Slider**](https://codepen.io/ShredderMing/pen/baRvKd)

## Usage

```js
import { h } from 'preact';
import Erizabesu from 'erizabesu';
import { Simple as Indicator } from 'erizabesu-indicators';
import { Simple as Arrow } from 'erizabesu-arrows';

const data = [
{
img: 'https://res.cloudinary.com/demo/image/upload/w_600,h_300/sample.jpg',
href: 'http://gintama.wikia.com/wiki/Elizabeth',
target: '_blank',
},
{
img: 'https://res.cloudinary.com/demo/image/upload/w_600,h_300/dog.jpg',
href: 'http://gintama.wikia.com/wiki/Elizabeth',
target: '_blank',
},
{
img: 'https://res.cloudinary.com/demo/image/upload/w_600,h_300/group.jpg',
href: 'http://gintama.wikia.com/wiki/Elizabeth',
target: '_blank',
},
{
img: 'https://res.cloudinary.com/demo/image/upload/w_600,h_300/bike.jpg',
href: 'http://gintama.wikia.com/wiki/Elizabeth',
target: '_blank',
},
{
img: 'https://res.cloudinary.com/demo/image/upload/w_600,h_300/woman.jpg',
href: 'http://gintama.wikia.com/wiki/Elizabeth',
target: '_blank',
},
];

const SimpleSlider = () => (





);
```

## Props

| Props | Type | Default Value | Description |
| ----------------- | ------- | ------------- | -------------------------------------------------- |
| `autoplay` | `bool` | `true` | |
| `autoplaySpeed` | `int` | `3000` | Delay between each auto scroll (in milliseconds) |
| `allowMouseSwipe` | `bool` | `true` | |
| `data` | `array` | `null` | [{img:'url',href:'url',target:'_blank'},{},{},...] |
| `infinite` | `bool` | `true` | swipe infinitely |