Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@dmchurch/react-mdl

dmchurch13MIT2.0.1

React Components for Material Design Lite

react, react-component, mdl, material-design, badge, button, card, checkbox, data-table, fab-button, icon, icon-button, icon-toggle, radio, radio-group, switch, textfield, progress, progress-bar, spinner, slider, tooltip, menu, dropdown, Layout, Drawer, Grid, Tabs

readme

React-MDL

Maintenance Status NPM version Build Status Linux Coverage Status

Deprecation notice

This library is now deprecated. It's higly recommended to use Material Design Components instead.

Description

React-MDL is a set of React components build on top of Material Design Litev1.2.1

Requirements

Instead of using the official material.css and material.js files from the MDL project, you should use the files we provide in /extra. The reason to that is because the official Layout component is not fully compatible with React. We made a patch and we re-exported everything so people can still use it. If you're worried about the changes we made, you can take a look at the patch note or read about the issue in this ticket.

<link rel="stylesheet" href="material.css">
<script src="material.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">

Create React App

The above instructions won’t work if you use Create React App with react-scripts higher than 0.4.0.
If you use it, add only this one line to your HTML:

<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">

Then add these lines to src/index.js:

import 'react-mdl/extra/material.css';
import 'react-mdl/extra/material.js';

Installation

npm install --save react-mdl

Usage

You can use React-MDL through a bundler like webpack or browserify by importing react-mdl in your application:

import { Button, Card, CardText } from 'react-mdl';

// or...
import Button from 'react-mdl/lib/Button';
import { Card, CardText, CardActions } from 'react-mdl/lib/Card';

Alternatively, you can include node_modules/react-mdl/out/ReactMDL.js as a script, but you'll likely want to copy it to a folder outside of node_modules first, such as lib or vendor. Then a global ReactMDL will be available:

const { Button, Card, CardText } = ReactMDL;

For a listing of available components, as well as specific usage information, check out the Components page on the website.

Some extra components can be found in the react-mdl-extra package.

License

MIT, see LICENSE.md for details.

changelog

Change Log

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

2.0.1 (2019-10-28)

Bug Fixes

  • react warning for component={ClassComponent} (5d0be63)
  • react warning on undefined initial state (c117b8c)

2.0.0 (2019-10-23)

  • refactor(react-16)!: Updating deps and tests for React 16 (53863a4)

Features

  • react-16: Updating to use new React 16 lifecycle methods (0971b62)

BREAKING CHANGES

  • Dropping support for React 0.14 and React 15

1.11.0 (2017-11-20)

Bug Fixes

Features

1.10.3 (2017-05-16)

1.10.2 (2017-05-02)

Bug Fixes

  • Tabs: Fix assign to readonly property (#486) (cf138c5), closes #486

1.10.1 (2017-04-26)

Bug Fixes

  • use PropTypes instead of React.PropTypes (#485) (d769b01)

1.10.0 (2017-04-14)

Bug Fixes

  • DataTable: Selected rows as props (#477) (900bdba), closes #404
  • IE10 dataTable selectable not able to use HTML5 data attributes (#457) (e1cc1dc)
  • Remove warnings by using the prop-types package for PropTypes (#484) (b9c6c1f)
  • ListItemContent: prevent the item to override the icon css classes (#449) (4414085), closes #445

Features

  • Textfield: enable element in checkbox and textfield (#311) (e74bbc1)

1.9.0 (2016-11-23)

Bug Fixes

  • Don't die if function::name is not configurable. (#437) (929534f)
  • Menu: Restore menu DOM after downgrade in order to allow react to cleanly unmount the component. (#435) (0069600), closes #426

Features

1.8.0 (2016-11-17)

Bug Fixes

  • pass the values of mdlRowProps on the row (#398) (a405631)

Features

  • Badge: Allow other props on Badge (#422) (af8c4eb)

1.7.2 (2016-09-12)

Bug Fixes

  • MDL: Update to MDL 1.2.1 (df7a3c1)

1.7.1 (2016-08-30)

Bug Fixes

  • Chip: Allow Chip to have more than 1 child (#385) (7616167), closes #384
  • HeaderTabs: Fix ripple effect (6034345), closes #380
  • Tabs: Remove the hack href "react-mdl-tabs-hack" (967be52), closes #381

1.7.0 (2016-08-21)

Bug Fixes

  • Cell: Remove required col prop (3ed1749)
  • Dialog: Using window height instead of body.clientHeight (#373) (b6c1a71), closes #370
  • ProgressBar: Fix unknown props (4547085)
  • Tabs: Fix js error when clicking on a tab (#376) (ca9309e), closes #376 #347

Features

  • Update MDL lib to version 1.2.0 (#375) (9ab92f9)
  • Chip: Add Chip component (#378) (c4ddfe7), closes #377

1.6.1 (2016-07-07)

Bug Fixes

  • DataTable: Fix infinite loop with onSelectionChanged (4d6b95d), closes #339
  • DataTable: Fix react unknown property warning (c7d7a7a)
  • List: Fix children proptype (7b1a5ee), closes #329
  • Shadows: Fix incorrect shadow level (7d3bdce), closes #314
  • Snackbar: Prevent unknown prop warning (#343) (a9b2a70)

1.5.4

New

  • Adds hideSpacer prop on the Header and HeaderRow (#282)

Fixes

  • Fixes the generated bundled React-MDL files (#301)
  • Fixes/Removes the default upgrade elements by MDL since it's done by our components (#302)

1.5.3

New

  • New documentation using gatsby

Fixes

  • Fixes Slider documentation (#268)
  • Fixes react export names in the bundle files (#267)
  • Fixes multiple is-invalid clasname on Textfield (#277)
  • Fixes Navigation not working with null/false children (#278)
  • Fixes Badge not retaining classnames from its child (#279)
  • Fixes Layout invariant violation error (#280)

1.5.2

Fixes

  • Fixes layout Header in small screens (#264)
  • Fixes uncontrolled Slider (#263)

1.5.1

Fixes

  • Fixes Slider UI background when it receives a new value (#261)
  • Fixes javascript error when using tabs (#255)

New

  • Adds jsnext:main field in package.json for ES6 build tools (#259)
  • Adds support for all version of React 15 rc.
  • Updates to MDL 1.1.3

1.5.0

New

  • Adds selectable and sortable props on the DataTable component. (#246)
  • Adds rowKeyColumn on the DataTable component. This allows users to specify the data from the specific column to use as key for each rows (usually id or uid). (#246)
  • Adds support of React 15 rc1.

1.4.4

Changes/Fixes

  • Updates to MDL 1.1.2

1.4.3

Fixes

  • Fixes documentation on IE by including the babel polyfill (#236)
  • Fixes Textfield initial invalid state (#241)
  • Tried to resolve memory issue while running tests (#230)

1.4.2

Fixes

1.4.1

Fixes

  • Do not close the Dialog with the escape key, by default. Can be customized with the onCancel prop. (#221).

1.4.0

New

  • New Dialog component (#207 by @Permagate).
  • New Snackbar component (#208).
  • New List component. (#201 with @darenju's help)
  • Adds overlap and noBackground prop in Badge.
  • Adds hideTop prop in Layout.
  • Adds position specific props in Tooltip (#214 by @Permagate).
  • Adds component prop in Tab in order to fix custom links (#116)

Fixes

  • Fixes layout.scss import paths (#138).
  • Fixes an issue in Textfield when a field replaces another one (#197)

Changes

  • Changes for attribute with data-mdl-for in Menu.

1.3.0

  • Adds the Text and Article templates on the documentation website
  • Adds hideDesktop, hidePhone, hideTablet props in Cell
  • Adds shadow prop in Grid and Cell
  • Adds component prop in Grid, Cell and Content
  • Changes HeaderRow to only render a Spacer if a title is present

1.2.0

  • Adds shadow prop on DataTable
  • Changes RadioGroup to be controlled or uncontrolled (#180)
  • Changes the propTypes of DataTable to be less strict
  • Adds tooltip and className in the column description of DataTable
  • Deprecates data in favor of rows in DataTable
  • Deprecates selectable in DataTable

1.1.0

  • Adds new tabBarProps to Tabs (#160)
  • Fixes the propTypes of Tabs (#160)
  • Fixes the error propType of Textfield (#179)

1.0.4

  • Fixes the validity of a TextField when specifying an error (#156)

1.0.3

  • Adds noSpacing prop to Grid component
  • Changes some propTypes in Layout to accept more renderables (#147)
  • Fixes the updates of disabledand checked on Checkbox (#136)
  • Fixes the updates of disabledand checked on Radio and IconToggle

1.0.2

  • Adds CardMedia component (#114)
  • New documentation website

1.0.1

  • Fixes imports module (#109)

1.0.0

  • Adds mdlUpgrade and MDLComponent are now exported. (#77)
  • Updates the internal Material Design Lite to 1.0.6 (#106)
  • Changes the path to some components (#85)
  • Changes ripple is now false by default (#90)
  • Fixes all components: the change function now provides the event object. (#83)
  • Fixes Textfield not being updated when receiving a value programmatically (#79)
  • Fixes Switch not being updated when receiving new checked/disabled value programmatically.
  • Fixes Badge won't be rendered if the child is empty/null. (#78)
  • Fixes Badge won't be rendered when the prop text is null or undefined. (#84)
  • Fixes HeaderTabs to work the same way as Tabs (#66)