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 🙏

© 2024 – Pkg Stats / Ryan Hefner

mithril-mdl-extended

v1.1.4

Published

Material Design Lite components via mithril.js

Downloads

5

Readme

Material Design Lite components via mithril.js

This module provides mithril components which construct HTML to be used with the Material Design Lite framework. It provides a simple way to apply the needed classes to create MDL components. It spits out normal HTML elements, and calls componentHandler.upgradeElement(element) on element creation. It is designed to work nicely with JSX (via babel or similar). Not nearly all components are supported right now. I will continue adding them when the need comes up. Your are welcome to submit pull requests :)

Basics

Some attributes will be used by all components and are carried over (id, class, config, href, disabled, value, for). This includes all on- event handlers.

And these attributes all apply some classes:

  • large: applies mdl-layout--large-screen-only
  • ripple: applies mdl-js-ripple-effect
  • active: applies is-active
  • primary: applies mdl-color--primary
  • primaryDark: applies mdl-color--primary-dark
  • shadow: applies mdl-shadow--${shadow}dp
  • color: applies mdl-color--${color}
  • textColor: applies mdl-color-text--${textColor}

Components

Components can be imported from the module directly:

ES6:

import {Button} from 'mithril-mdl';

ES5:

var Button = require('mithril-mdl').Button;

You may then use them like so: JSX:

m.render(document.body, <Button ripple accent raised>I am a button!</Button>);

ES5/ES6:

m.render(document.body, m(Button, {ripple: true, accent: true, raised: true}, 'I am a button!'));

Documentation for all components can be found in the docs/components directory.

Mixins

Mixins are often provided as lowercase versions of the corresponding components. They are annotated in the components documentation. More information can be found here.

Example:

import {Cell, grid} from 'mithril-mdl';

/**
 * Creates a cell with a grid mixin.
 * Cell will be passed attr, grid will use grid--attr instead.
 * Cell and grid will both use attr2
 */
export default <Grid>
	<Cell mixin={grid} attr="value1" grid--attr="value2" attr2="value3">
		<Cell>Some Stuff</Cell>
	</Cell>
</Grid>