# custom-range

> This is a [Custom Element](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) that mimics the native `` in a more styling-friendly way. It aims to offer the same HTML/JS API.

Latest version **1.1.0** (published 2020-05-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install custom-range
pnpm add custom-range
yarn add custom-range
bun add custom-range
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2020-05-06 |
| First published | 2019-04-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | ondras |

## Links

- npm: https://www.npmjs.com/package/custom-range
- Repository: https://github.com/ondras/custom-range
- Issues: https://github.com/ondras/custom-range/issues
- npm.io page: https://npm.io/package/custom-range

## Recent versions

- 1.1.0 (latest) — 2020-05-06
- 1.0.3 — 2020-03-10
- 1.0.2 — 2019-04-30
- 1.0.1 — 2019-04-30
- 1.0.0 — 2019-04-30

## README

# <x-range>

This is a [Custom Element](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) that mimics the native `<input type=range>` in a more styling-friendly way. It aims to offer the same HTML/JS API.

## Usage

Simply declare `<x-range></x-range>` within your HTML markup. You also need to include a script file (`range.js`) and a stylesheet file (`range.css`). Possible approaches include [cloning the project](https://github.com/ondras/x-range.git), using [npm](https://www.npmjs.com/package/custom-range) or linking via CDN.

```html
<head>
	<script src=https://unpkg.com/custom-range@1/range.js></script>
	<link rel=stylesheet href=https://unpkg.com/custom-range@1/range.css />
</head>
<body>
	<x-range></x-range>

	<x-range min=10 max=50 step=5 value=20></x-range>
</body>
```

There is a [sample fiddle](https://jsfiddle.net/ondras/o1kpw6jy/) available.

## Browser support

No idea.

## Styling

Mostly via [CSS Custom Properties](https://developer.mozilla.org/en-US/docs/Web/CSS/--*). Here are the defaults:

```css
x-range {
	--thumb-size: 8px;
	--thumb-color: #fff;
	--thumb-shadow: #000;
	--thumb-hover-color: #ddd;

	--track-size: 4px;
	--track-color: #888;
	--track-shadow: #000;

	--elapsed-color: #ddd;

	--remaining-color: transparent;
}
```

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