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

https://github.com/lukewarlow/wc-horizontal-scroller

A web component for a horizontal scroller (carousel)
https://github.com/lukewarlow/wc-horizontal-scroller

carousel carousel-component component scroller webcomponent webcomponents

Last synced: 4 months ago
JSON representation

A web component for a horizontal scroller (carousel)

Awesome Lists containing this project

README

          

# Horizontal Scroller Web Component

[![npm](https://img.shields.io/npm/v/wc-horizontal-scroller.svg?style=flat-square)](https://www.npmjs.com/package/wc-horizontal-scroller)

A web component for a horizontal scroller (carousel)

### Install

```shell
$ npm i wc-horizontal-scroller
```
### Usage

Firstly, you need to register the custom element.

```js
import HorizontalScroller from "wc-horizontal-scroller";

window.customElements.define('horizontal-scroller', HorizontalScroller);
```

Then you can use it in your HTML. You must provide an ID for the element.

```html

Item 1

Item 2

```

#### Fullscreen

By default, clicking on the element will expand it to cover most of the viewport. This can be disabled by adding the `no-fullscreen` attribute to the custom element.

## License

This project is licensed under the [MIT License](https://github.com/lukewarlow/wc-horizontal-scroller/blob/master/LICENSE).