0.0.7 • Published 7 years ago

mn-number v0.0.7

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

npm version Dependency Status MIT Licence

mn-number

A input component (type number), with minimalist design.

See the demo

preview demo

Install

npm install --save mn-number

And bundle dependencies and main files in dist/ with your preferred tool.

Usage

And then, in your html, you can use the tag mn-number e.g.

<mn-number placeholder="Number"></mn-number>
<mn-number placeholder="Number (with max 10)" max="10"></mn-number>

The following attributes from inputs are supported in this component

Integer or Float

By default, mn-number accept only integer numbers, if you want a float number, use the attribute decimal and assign to it a precision, by default is 2, e.g.

<mn-number placeholder="Float number" decimal></mn-number>
<mn-number placeholder="Float number with precision 3" decimal="2"></mn-number>

You can use too, currency and percentage

<mn-number placeholder="money" currency></mn-number>
<mn-number placeholder="money with high precision" currency="4"></mn-number>
<mn-number placeholder="percentage" percentage></mn-number>

Suffix

Maybe you need a different suffix, like 10 m (meters), or 10 mph (miles per hour). So, to implement your own suffix, just add a CSS selector, like:

mn-number.mph .mask:after {
  content: 'mph';
}

and sure, add the class .mph to your mn-number

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago