# webrouk-custom-number

> Webrouk Custom Number is a lightweight native JavaScript web component for custom input number.

Latest version **1.0.3** (published 2023-12-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install webrouk-custom-number
pnpm add webrouk-custom-number
yarn add webrouk-custom-number
bun add webrouk-custom-number
```

## 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.0.3 |
| Published | 2023-12-23 |
| First published | 2022-03-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Muhammad Mabrouk |
| Maintainers | muhammad_mabrouk |
| Keywords | input, number, input-number, js, vanilla, vanilla-js, component, web-component, webrouk |

## Links

- npm: https://www.npmjs.com/package/webrouk-custom-number
- Repository: https://github.com/MuhammadMabrouk/webrouk-custom-number
- Homepage: https://github.com/MuhammadMabrouk/webrouk-custom-number#readme
- Issues: https://github.com/MuhammadMabrouk/webrouk-custom-number/issues
- npm.io page: https://npm.io/package/webrouk-custom-number

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.3 (latest) — 2023-12-23
- 1.0.2 — 2022-06-11
- 1.0.1 — 2022-03-22
- 1.0.0 — 2022-03-22

## README

# webroukCustomNumber

Webrouk Custom Number is a lightweight native JavaScript web component for custom input number.

- No dependencies.
- Small and fast.
- Writes its value right into input value field. This makes it easy to use in any html form.

### Demo
---
[CodePen Example](https://codepen.io/muhammad_mabrouk/full/QWaKPQE/)

### Installation
---
Use [NPM](https://www.npmjs.com/package/webrouk-custom-number/) to download and install it directly in to your project

```sh
$ npm install webrouk-custom-number --save
```

or include js file manually

```html
<!-- webrouk-custom-number component file -->
<script src="webrouk-custom-number.js"></script>
```

### Usage
---
Using webroukCustomNumber is simple. Configuration over attributes.

```html
<webrouk-custom-number min="0" max="100" step="10" value="30">
  <!-- This input will receive the value from the component -->
  <input type="hidden">
</webrouk-custom-number>
```

### Options
| Option | Type | Description | Default |
| ----------- |    :----:   | ----------- |    :----:   |
| min | `number` | Specifies the minimum value allowed | `0` |
| max | `number` | Specifies the maximum value allowed | `null` |
| step | `number` | Specifies the legal number intervals | `1` |
| value | `number` | Specifies the default value | `min` &#124; `0` |
| percent | `boolean` | Whether or not to show the percentage display | `false` |
| disabled | `boolean` | Specifies the disabled state of the input | `false` |

### Styleable Component Parts
---
- root
- input
- btn btn-up
- btn btn-down

#### Example:

```css
webrouk-custom-number::part(root) {
  position: relative;
}

webrouk-custom-number::part(input) {
  display: block;
  height: 44px;
  width: 100%;
  text-align: center;
  padding: 0 44px;
}

webrouk-custom-number::part(btn) {
  position: absolute;
  top: 0;
  bottom: 0;
  height: 44px;
  width: 44px;
  background-color: blue;
  color: white;
}

webrouk-custom-number::part(btn-up) {
  right: 0;
}

webrouk-custom-number::part(btn-down) {
  left: 0;
}
```

### License
-------
webroukCustomNumber is licensed [MIT](https://choosealicense.com/licenses/mit/).
It can be used for free and without any attribution, in any personal or commercial project.

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