├── .gitignore ├── README.md ├── lib ├── appbar.js ├── button.js ├── checkbox.js ├── col.js ├── container.js ├── divider.js ├── dropdown-item.js ├── dropdown.js ├── form.js ├── index.js ├── input.js ├── modal.js ├── option.js ├── panel.js ├── radio.js ├── row.js ├── select.js ├── tab.js ├── tabs.js └── textarea.js ├── package.json ├── rollup.config.index.js ├── rollup.config.js └── src └── components ├── appbar └── index.js ├── button └── index.js ├── checkbox └── index.js ├── col └── index.js ├── container └── index.js ├── divider └── index.js ├── dropdown-item └── index.js ├── dropdown └── index.js ├── form └── index.js ├── index.js ├── input └── index.js ├── modal └── index.js ├── option └── index.js ├── panel └── index.js ├── radio └── index.js ├── row └── index.js ├── select └── index.js ├── tab └── index.js ├── tabs └── index.js └── textarea └── index.js /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # preact-mui 2 | 3 | [![npm package](https://img.shields.io/badge/npm-v0.1.0-blue.svg)](https://www.npmjs.com/package/preact-mui) 4 | 5 | >The MUI CSS Preact library is designed from the ground up to be fast, small and developer-friendly. Using the MUI Preact library you can add MUI components to your Preact apps and switch seamlessly between MUI CSS/JS and MUI Preact even within the same app. 6 | 7 | --- 8 | 9 | ### Components Example 10 | 11 | [**Preact MUI CSS Components **](http://preact-mui.surge.sh/) 12 | 13 | 14 | ### Get Started 15 | 16 | To use MUI Preact you must include the MUI CSS and JS file in your HTML payload: 17 | ```html 18 | 20 | 21 | ``` 22 | 23 | #### Install 24 | 25 | `npm install preact-mui` 26 | 27 | 28 | #### Using Components 29 | 30 | ```javascript 31 | // Access components individually for smaller build files (RECOMMENDED) 32 | import Appbar from 'preact-mui/lib/appbar'; 33 | import Button from 'preact-mui/lib/button'; 34 | import Container from 'preact-mui/lib/container'; 35 | 36 | // Access all components from preact-mui module 37 | import { Appbar, Button, Container } from 'preact-mui'; 38 | 39 | // Preact-MUI also supports ES5 syntax 40 | var preactMui = require('preact-mui'); 41 | var Appbar = preactMui.Appbar; 42 | var Button = preactMui.Button; 43 | var Container = preactMui.Container; 44 | ``` 45 | 46 | #### Real life example: 47 | 48 | ```javascript 49 | import {h, Component, render} from 'preact'; 50 | 51 | import Appbar from 'preact-mui/lib/appbar'; 52 | import Button from 'preact-mui/lib/button'; 53 | import Container from 'preact-mui/lib/container'; 54 | 55 | class Example extends React.Component { 56 | render() { 57 | return ( 58 |
59 | 60 | 61 | 62 | 63 |
64 | ); 65 | } 66 | } 67 | 68 | render(, document.getElementById('example')); 69 | ``` 70 | 71 | ### API 72 | Preact-MUI has the same API with React MUI, then you can check tre React API and use the same with Preact-MUI. 73 | 74 | MUI CSS React API 75 | 76 | --- 77 | 78 | ## API Documentation 79 | 80 | ### Preact Library 81 | 82 | All of the MUI React components can be accessed as top-level attributes of the `preact-mui` package. In addition, they can be accessed individually at `preact/lib/{component}`. 83 | 84 | #### Appbar 85 | 86 | ```jsx 87 | import Appbar from 'preact-mui/lib/appbar'; 88 | 89 | 90 | ``` 91 | 92 | Read more: https://www.muicss.com/docs/v1/react/appbar 93 | 94 | #### Button 95 | 96 | ```jsx 97 | import Button from 'preact-mui/lib/button'; 98 | 99 |