
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
mithril-mdl
Advanced tools
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.upgradeDom() after each render pass. 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 :)
Some attributes will be used by all components.
The following attributes will be carried over to the topmost resulting element:
idclassconfigdisabledon (onclick, onchange, etc.)And these attributes all apply some classes:
large: applies mdl-layout--large-screen-onlyripple: applies mdl-js-ripple-effectactive: applies is-activeprimary: applies mdl-color--primaryprimaryDark: applies mdl-color--primary-darkThe following components can be imported from the module directly.
ES5
var Button = require('mithril-mdl').Button;
ES6
import {Button} from 'mithril-mdl';
You may then use them like so:
ES5
m.render(document.body, m(Button, {ripple: true, accent: true, raised: true}, 'I am a button!'));
JSX
m.render(document.body, <Button ripple accent raised>I am a button!</Button>);
Tag: button
Class: mdl-button mdl-js-button mdl-button--fab
Attributes:
mini: Switches mdl-button--fab to mdl-button--mini-fabcolor: Sets mdl-button--coloredaccent: Sets mdl-button--accentraised: Sets mdl-shadow--4dpprimary: Sets mdl-button--primaryTag: button
Class: mdl-button mdl-js-button
Attributes:
color: Sets mdl-button--coloredaccent: Sets mdl-button--accentraised: Sets mdl-button--raisedprimary: Sets mdl-button--primaryTag: i
Class: material-icons
Tag: div
Class: mdl-layout__spacer
Tag: div
Class: mdl-progress mdl-js-progress mdl-progress__indeterminate
Attributes:
progress: A number which will be passed to MaterialProgress.setProgress(). If set also removes mdl-progress__indeterminatebuffer: A number which will be passed to MaterialProgress.setBuffer().WARNING: The JavaScript portion of this is not tested across redraws and might break.
Tag: div wrapping input, label and optionally span
Class: mdl-textfield mdl-js-textfield, mdl-textfield__label and mdl-textfield__error
Attributes:
All default attributes (class, id etc.) are assigned to the input element. id has to be passed to allow for a label.
value: sets value of the inputlabel: sets text content of the labelerror: if this and pattern is set, adds a span, with this text set as its text content.pattern: sets pattern property of the inputfloating: sets mdl-textfield--floating-label on the divouterClass: additional classes to apply to the div (should be a string)Tag: div
Class: mdl-grid
Tag: div
Class: mdl-cell
Attributes:
align: sets mdl-cell--${align}. Should be top, stretch or bottomwidth: sets mdl-cell--${width}-col. Basically the number of columns for this cellphone: sets mdl-cell--${phone}-col-phonetablet: sets mdl-cell--${tablet}-col-tabletdesktop: sets mdl-cell--${desktop}-col-desktopnophone: sets mdl-cell--hide-phonenotablet: sets mdl-cell--hide-tabletnodesktop: sets mdl-cell--hide-desktopTag: div
Class: mdl-layout__tab-bar
Tag: a
Class: mdl-layout__tab
Attributes:
href: Transferred overTag: header
Class: mdl-layout__header
Attributes:
scroll: Sets mdl-layout__header--scrollwaterfall: Sets mdl-layout__header--waterfalltransparent: Sets mdl-layout__header--transparentTag: span
Class: mdl-layout-title
Tag: div
Class: mdl-layout mdl-js-layout
Attributes:
drawer: If this or fixedDrawer is provided, sets mdl-layout--overlay-drawer-buttonfixedDrawer: Sets mdl-layout--fixed-drawerfixedHeader: Sets mdl-layout--fixed-headerfixedTabs: Sets mdl-layout--fixed-tabsTag: div
Class: mdl-layout__header-row
Tag: div
Class: mdl-navigation
Tag: a
Class: mdl-navigation__link
Attributes:
href: Transferred overTag: div
Class: mdl-layout__drawer
Tag: main
Class: mdl-layout__content
FAQs
Material Design Lite components via mithril.js
We found that mithril-mdl demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.