Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prateekbh/preact-material-components
preact wrapper for "Material Components for the web"
https://github.com/prateekbh/preact-material-components
material-components preact preact-components
Last synced: 7 days ago
JSON representation
preact wrapper for "Material Components for the web"
- Host: GitHub
- URL: https://github.com/prateekbh/preact-material-components
- Owner: prateekbh
- License: mit
- Created: 2017-02-20T17:01:45.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-11-28T11:08:04.000Z (about 4 years ago)
- Last Synced: 2024-10-29T17:32:25.971Z (2 months ago)
- Topics: material-components, preact, preact-components
- Language: TypeScript
- Homepage: https://material.preactjs.com
- Size: 92.4 MB
- Stars: 554
- Watchers: 9
- Forks: 81
- Open Issues: 59
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-preact - Preact Material Components - Preact wrapper for "Material Components for the web". (Uncategorized / Uncategorized)
- awesome-material-components - prateekbh/preact-material-components
README
# preact-material-components
## Deprecation Notice
This repo only works with Preact 8 or lower. The work for preact X+ compatibility was unfortunately suspended due to the given lack of maintainers and their time.[![Greenkeeper badge](https://badges.greenkeeper.io/prateekbh/preact-material-components.svg)](https://greenkeeper.io/)
[![Dependencies badge](https://david-dm.org/prateekbh/preact-material-components.svg)](https://david-dm.org/)
[![build](https://api.travis-ci.org/prateekbh/preact-material-components.svg?branch=master)](https://api.travis-ci.org/prateekbh/preact-material-components.svg?branch=master)preact components for [material-components-web](https://material.io/develop/web)
---
These components bring material components in an a-la-carte fashion.
You can use `n` number of components without taking the weight of any extra code of the components you do not use.`preact-material-components` is a thin opinion-less wrapper over [material-components-web](https://github.com/material-components/material-components-web/tree/master/packages). Use these for painless integration of these components into your project, without taking the bloat.
Smaller bundles FTW!!!
## Which distribution to use
There are now three distributions:
#### Default Build
Location: Package Root / `preact-material-components/`
Who?
- Libraries: ✖ (Users should decide about transpilation themselves)
- Applications: ✔Support:
This supports all browsers supported by mwc, JavaScript and TypeScript
#### ES Module Build
Location: `esm` directory / `preact-material-components/esm/`
Who?
- Libraries: ✔
- Applications: ✔Support:
This supports most recent browsers, JavaScript and TypeScript
#### TypeScript Source
Location: `ts` directory / `preact-material-components/ts/`
Who?
- Libraries: (✔) (Not recommended, keep in mind that your library will only support TypeScript)
- Applications: ✔Support:
Browser support depends on transpilation/TypeScript configuration and only TypeScript is supported.
## FAQ
### Error while using preact-material-components with **less**
If you are using less-loader you have to set **strictMath: true** option in your webpack config
```
{
loader: 'less-loader',
options: { strictMath: true }
}
```### Primary and Secondary props not working
To use theming props like primary/secondary, you'll need to include Theme's css
```
import 'preact-material-components/Theme/style.css';
```## Docs and Demos
https://material.preactjs.com/
---
**P.S.:** Let us know if you're using `preact-material-components` we would love to hear your experiences.