3 releases (breaking)

0.3.0 Jan 17, 2023
0.2.0 Jun 19, 2022
0.1.0 May 19, 2021

#1387 in Web programming

Download history 17/week @ 2024-07-22 59/week @ 2024-07-29 16/week @ 2024-08-05 20/week @ 2024-08-12 91/week @ 2024-08-19 32/week @ 2024-08-26 5/week @ 2024-09-02 16/week @ 2024-09-09 9/week @ 2024-09-16 58/week @ 2024-09-23 27/week @ 2024-09-30 34/week @ 2024-10-07 21/week @ 2024-10-14 84/week @ 2024-10-21 23/week @ 2024-10-28 23/week @ 2024-11-04

152 downloads per month

Apache-2.0

790KB
4.5K SLoC

Rust 4K SLoC // 0.0% comments JavaScript 887 SLoC

Material Yew

Material Yew is a components library for Yew framework which is a wrapper around Material Web Components exposing Yew components. All modern browsers are supported. There is no support for polyfills required by Internet Explorer 11.

Example

use material_yew::MatButton;
use yew::html;

html! {
    <MatButton label="Click me!" />
};

Getting started

Installation

Cargo.toml:

[dependencies]
material-yew = "0.2"

Material icons and a Material font can also be imported for full functionality.
index.html:

<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet">

It's also important to note that you need viewport meta tag for the Material Components to be responsive.

<meta name="viewport" content="width=device-width, initial-scale=1.0">

Feature flags

Following are all the cargo features available (each feature corresponds to its respective component):

  • button
  • circular-progress
  • checkbox
  • circular-progress-four-color
  • drawer
  • top-app-bar
  • icon-button
  • fab
  • formfield
  • linear-progress
  • icon
  • radio
  • switch
  • top-app-bar-fixed
  • dialog
  • list
  • icon-button-toggle
  • slider
  • tabs
  • snackbar
  • textfield
  • textarea
  • select
  • menu

full feature enables all the components

Theming

These components respect the theming applied to Material Web Components using stylesheets. Learn about how to theme Material Web Components.

Documentation

Full API documentation can be found here. Demos of components can be found here.

Contributing

  1. Fork it (https://github.com/hamza1311/material-yew)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Dependencies

~11–20MB
~267K SLoC