mdl-currency-usd
An Material Design Lite currency textfield implementation for capturing user entered US currency values (https://github.com/google/material-design-lite)
A custom textfield implementation of a US currency component for Material Design Lite
Install
Via npm:
npm install mdl-currency-usd
Then include in your html:
<link rel="stylesheet" href="./bower_components/mdl-currency-usd/dist/mdl-currency-usd.min.css">
...
<script src="./bower_components/mdl-currency-usd/dist/mdl-currency-usd.min.js"></script>
Basic use
To use any MDL component, you must include the minified CSS and JavaScript files using standard relative-path references in the <head>
section of the page, as described in the MDL Introduction.
To include a MDL currency-usd textfield component:
1. Code a <div>
element to hold the currency text field.
...
2. Inside the div, code an <input>
element add an id
attribute of your choice.
3. Also inside the div, after the <input>
field, code a <label>
element with a for
attribute whose value matches the input
element's id
value, and a short string to be used as the field's placeholder text.
currency Example...
4. Add one or more MDL classes, separated by spaces, to the div container, input field, input label, and error message using the class
attribute.
currency Example...
The currency textfield component is ready for use.
Examples
currency field with a standard label.
currency Example...
currency field with a floating label.
currency Example...
currency field with a standard label, and error message.
currency Example... #.##
currency field with a standard label, symbol, and error message.
currency Example... $ #.##
currency field with floating label, symbol, error message, and 12 integer 2 decimal constraint
currency 12.2 Example... $ #.##