npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@material-git/input

v2.0.0-git.20160919

Published

Angular 2 Material input

Readme

mdInput

Inputs are the basic input component of Material 2. The spec can be found here.

Notes

  • The <md-input> component fully support two-way binding of ngModel, as if it was a normal <input>.

Type

At the time of writing this README, the [type] attribute is copied to the actual <input> element in the <md-input>.

The valid type attribute values are any supported by your browser, with the exception of file, checkbox and radio. File inputs aren't supported for now, while check boxes and radio buttons have their own components.

Prefix and Suffix

You can include HTML before, and after the input tag, as prefix or suffix. It will be underlined as per the Material specification, and clicking it will focus the input.

To add a prefix, use the md-prefix attribute on the element. Similarly, to add a suffix, use the md-suffix attribute. For example, in a template:

Example

<md-input placeholder="amount" align="end">
  <span md-prefix>$&nbsp;</span>
  <span md-suffix>.00</span>
</md-input>

Will result in this:

Hint Labels

Hint labels are the labels that shows the underline. You can have up to two hint labels; one on the start of the line (left in an LTR language, right in RTL), or one on the end.

You specify a hint-label in one of two ways; either using the hintLabel attribute, or using an <md-hint> directive in the <md-input>, which takes an align attribute containing the side. The attribute version is assumed to be at the start.

Specifying a side twice will result in an exception during initialization.

Example

A simple character counter can be made like the following:

<md-input placeholder="Character count (100 max)" maxlength="100" class="demo-full-width"
          value="Hello world. How are you?"
          #characterCountHintExample>
  <md-hint align="end">{{characterCountHintExample.characterCount}} / 100</md-hint>
</md-input>

Divider Color

The divider (line under the <md-input> content) color can be changed by using the dividerColor attribute. A value of primary is the default and will correspond to your theme primary color. Alternatively, you can specify accent or warn.

Example

^((please note that this example has been doctored to show the colors; they would normally show only on focus)^)

Labelling

You can label the <md-input> as you would a regular <input>.

Full Forms

You can make a full form using inputs, and it will support autofill natively.

Example

<md-card class="demo-card demo-basic">
  <md-toolbar color="primary">Basic</md-toolbar>
  <md-card-content>
    <form>
      <md-input class="demo-full-width" placeholder="Company (disabled)" disabled value="Google">
      </md-input>

      <table style="width: 100%" cellspacing="0"><tr>
        <td><md-input placeholder="First name" style="width: 100%"></md-input></td>
        <td><md-input placeholder="Long Last Name That Will Be Truncated" style="width: 100%"></md-input></td>
      </tr></table>
      <p>
        <md-input class="demo-full-width" placeholder="Address" value="1600 Amphitheatre Pkway"></md-input>
        <md-input class="demo-full-width" placeholder="Address 2"></md-input>
      </p>
      <table style="width: 100%" cellspacing="0"><tr>
        <td><md-input class="demo-full-width" placeholder="City"></md-input></td>
        <td><md-input class="demo-full-width" placeholder="State"></md-input></td>
        <td><md-input #postalCode class="demo-full-width" maxlength="5"
                      placeholder="Postal Code"
                      value="94043">
          <md-hint align="end">{{postalCode.characterCount}} / 5</md-hint>
        </md-input></td>
      </tr></table>
    </form>
  </md-card-content>
</md-card>

Will result in this: