Socket
Socket
Sign inDemoInstall

webrouk-custom-number

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    webrouk-custom-number

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


Version published
Maintainers
1
Install size
11.1 kB
Created

Readme

Source

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

Installation


Use NPM to download and install it directly in to your project

$ npm install webrouk-custom-number --save

or include js file manually

<!-- webrouk-custom-number component file -->
<script src="webrouk-custom-number.js"></script>

Usage


Using webroukCustomNumber is simple. Configuration over attributes.

<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

OptionTypeDescriptionDefault
minnumberSpecifies the minimum value allowed0
maxnumberSpecifies the maximum value allowednull
stepnumberSpecifies the legal number intervals1
valuenumberSpecifies the default valuemin | 0
percentbooleanWhether or not to show the percentage displayfalse
disabledbooleanSpecifies the disabled state of the inputfalse

Styleable Component Parts


  • root
  • input
  • btn btn-up
  • btn btn-down
Example:
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. It can be used for free and without any attribution, in any personal or commercial project.

Keywords

FAQs

Last updated on 23 Dec 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc