Skip to content

Modular implementation of Material Design for Mithril.

Notifications You must be signed in to change notification settings

jsguy/polythene

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Polythene

Join the chat at https://gitter.im/ArthurClemens/Polythene CDNJS

Modular implementation of Material Design for Mithril.

Background

Setup

Polythene uses Node tools to build. It runs in the browser.

Source files are written in es6 and transpiled to es5. The building blocks are async es6 modules and loaded when needed, but using SystemJS / jspm / Browserify it is also possible to create bundles where all required modules are combined.

Polythene works both in es6 and es5 applications.

Basic example

A simple es6 module that shows a button:

import m from 'mithril';
import button from 'polythene/button/button';
import 'polythene/theme/theme';

const app = {
    view: () => {
        return m('div', [
            m.component(button, {
                label: 'Button',
                raised: true
            })
        ]);
    }
};

m.mount(document.body, app);

Standalone version

A standalone script is included for use on JSBin / JSFiddle. Include this script:

https://rawgit.com/ArthurClemens/Polythene/master/polythene-standalone.js

Installation

You will need:

  • Polythene - the core components (this repository; see instructions below)
  • Polythene examples - (optional) to see implementations of components

Using npm with SystemJS or Browserify

npm install polythene

Using jspm

jspm install github:ArthurClemens/Polythene

Using Polythene with es5

When using Browserify, use require to get components:

var m = require('mithril');
require('polythene/theme/theme');
var btn = require('polythene/button/button');

Developing

Transpile everything:

  • npm run transpile .

Transpile dialog component:

  • npm run transpile dialog

Browser support

The default theme uses flexbox, so this works in IE10 and other browsers. For IE9 you will need to adapt the theme.

Project progress

Done

  • Button
  • Card
  • Checkbox
  • Dialog
  • Divider (part of List)
  • Floating Action Button
  • Header panel
  • Icon
  • Icon button (toggle button)
  • List
  • List tile
  • Menu, Simple menu
  • Notification and Snackbar
  • Radio button
  • Ripple
  • Search
  • Shadow
  • Slider
  • Spinner
  • Subheader (part of List)
  • SVG
  • Switch
  • Tabs
  • Text field
  • Theming
  • Toolbar
  • Validation

To do

  1. Collapse
  2. Dropdown button
  3. Progress bar
  4. Bottom sheet
  5. Grid list
  6. Data table
  7. Stepper
  8. Tooltip
  9. Side menu
  10. Picker
  11. Chip
  12. Reorder list

License

MIT

About

Modular implementation of Material Design for Mithril.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.9%
  • HTML 0.1%