Home
Softono
material-web-components-react

material-web-components-react

Open source MIT TypeScript
45
Stars
2
Forks
4
Issues
0
Watchers
1 year
Last Commit

About material-web-components-react

Material Web Components for React ⚛

Platforms

Web Self-hosted

Languages

TypeScript

Material Web Components for React

npm version release docs docs

A thin React wrapper over @material/web. Aims to be a locally-installable, accessible and customizable Material standard for React. Recommended to use with MUI. Free. Open Source. Looking for maintainers.

hero

Installation

To use Material Web Components for React as a library in your project, run:

npm install material-web-components-react

Usage

Here's a general example of how the components can be used:

import React from 'react';
import Button from 'material-web-components-react/button';

function Example() {
  return (
    <div>
      <Button>Click me</Button>
    </div>
  );
}

For a detailed reference on usage, you might want to check out the source code of the NextJS demo. It's simple!

Under the hood, this library simply uses the official @material/web components. Visit the official Material Web Components docs to learn how to use those components. The props remain the same!

Contributing

Local Development Setup 💻

  1. Fork this repository

  2. Clone your forked copy of the project

  3. Change to the project directory

  4. To get started, ensure you have pnpm installed globally, run the following command:

npm install -g pnpm
  1. To install all project dependencies, run the following command:
pnpm i
  1. To build the project, run the following commands (these needs to be done only once):
cd packages/ui
pnpm build
  1. Return to the monorepo root:
cd ../../
  1. To run the code locally, run the following code:
pnpm dev

This will run the demo app on http://localhost:3000, and whenever you update the library, the app should rebuild

Roadmap 🚀

Credits

Huge shout out to Elizabeth Mitchell (asyncLiz) and the rest of the Material Design team for their awesome Web Components implementation.

Thank you Travis Reeder for your Web Component implementation of Navigation Rail. I had to copy it to this project. I couldn't use yours directly because it would import @material/web again and bring conflicts.

Thanks for making the crappy, brain-dead wrapper components:

Thanks for improving the demo:

Thanks for building BottomSheet and Snackbar: