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

mdl-selectfield-component

v1.0.1

Published

Material Design Lite select field component

Readme

mdl-selectfield

Material Design Lite (MDL) select field component using Text Fields and Menus.

gitcheese paypal

Quick start

  • Install via Bower : bower install mdl-selectfield-component
  • Install via NPM : npm install mdl-selectfield-component

Getting started

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.

<!-- material-design-lite -->
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.indigo-pink.min.css">
<script defer src="https://code.getmdl.io/1.3.0/material.min.js"></script>

<!-- mdl-selectfield -->
<link rel="stylesheet" href="path_to/mdl-selectfield/mdl-selectfield.min.css">
<script defer src="path_to/mdl-selectfield/mdl-selectfield.min.js"></script>

mdl-selectfield can be used with any color schemes. It uses the indigo-pink color scheme but if you want to use another one, just modify the color-primary variable with the color scheme you want to use in the bower_components/material-design-lite/src/_variables.scss file or node_modules/material-design-lite/src/_variables.scssfile depending on the package manager you are using. Finally, regenerate the minified CSS files using gulp build:css. The new minified CSS files are available in the dist/ folder.

How to use

  1. Add a text field.
<div class="mdl-textfield mdl-js-textfield">
  <input class="mdl-textfield__input" type="text" id="my-super-selectfield">
  <label class="mdl-textfield__label" for="my-super-selectfield">Text...</label>
</div>
  1. Add mdl-selectfield and mdl-js-selectfield classes, separated by spaces, to the div container.
<div class="mdl-textfield mdl-js-textfield mdl-selectfield mdl-js-selectfield">
  <input class="mdl-textfield__input" type="text" id="my-super-selectfield">
  <label class="mdl-textfield__label" for="my-super-selectfield">Text...</label>
</div>
  1. Inside the div, after the <label>, add a menu.
<div class="mdl-textfield mdl-js-textfield mdl-selectfield mdl-js-selectfield">
  <input class="mdl-textfield__input" type="text" id="my-super-selectfield">
  <label class="mdl-textfield__label" for="my-super-selectfield">Text...</label>
  <ul class="mdl-menu mdl-menu--bottom-right mdl-js-menu mdl-js-ripple-effect" for="my-super-selectfield">
    <li class="mdl-menu__item">Some Action</li>
    <li class="mdl-menu__item">Another Action</li>
    <li disabled class="mdl-menu__item">Disabled Action</li>
    <li class="mdl-menu__item">Yet Another Action</li>
  </ul>
</div>

The select field component is ready for use.

Examples

You can see a live example on CodePen.

Simple select field

<div class="mdl-textfield mdl-js-textfield mdl-selectfield mdl-js-selectfield">
  <input class="mdl-textfield__input" type="text" id="sample1">
  <label class="mdl-textfield__label" for="sample1">Text...</label>
  <ul class="mdl-menu mdl-menu--bottom-right mdl-js-menu mdl-js-ripple-effect" for="sample1">
    <li class="mdl-menu__item">Some Action</li>
    <li class="mdl-menu__item">Another Action</li>
    <li disabled class="mdl-menu__item">Disabled Action</li>
    <li class="mdl-menu__item">Yet Another Action</li>
  </ul>
</div>

Select field with floating label

<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label mdl-selectfield mdl-js-selectfield">
  <input class="mdl-textfield__input" type="text" id="sample2">
  <label class="mdl-textfield__label" for="sample2">Text...</label>
  <ul class="mdl-menu mdl-menu--bottom-right mdl-js-menu mdl-js-ripple-effect" for="sample2">
    <li class="mdl-menu__item">Some Action</li>
    <li class="mdl-menu__item">Another Action</li>
    <li disabled class="mdl-menu__item">Disabled Action</li>
    <li class="mdl-menu__item">Yet Another Action</li>
  </ul>
</div>