Convert Figma logo to code with AI

zdhxiong logomdui

Material Design 3(Material You) UI components using Web Components.

4,151
362
4,151
22

Top Related Projects

A JavaScript library to position floating elements and create interactions for them.

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.

39,623

🐉 Vue Component Framework

Materialize, a CSS Framework based on Material Design

Material Design Components in HTML/CSS/JS

49,259

Modern CSS framework based on Flexbox

Quick Overview

MDUI is a lightweight and modular front-end framework for developing fast and powerful web interfaces. It follows Material Design guidelines and provides a set of responsive UI components and utilities for building modern web applications.

Pros

  • Lightweight and fast, with a small footprint
  • Follows Material Design principles for a consistent and attractive UI
  • Modular architecture allows for easy customization and extension
  • Comprehensive documentation and examples available

Cons

  • Limited community support compared to more popular frameworks
  • May require additional effort to customize for non-Material Design projects
  • Some advanced components may not be as feature-rich as in larger frameworks

Code Examples

  1. Creating a basic button:
<button class="mdui-btn mdui-btn-raised mdui-ripple">Button</button>
  1. Implementing a simple dialog:
mdui.dialog({
  title: 'Dialog Title',
  content: 'This is the dialog content.',
  buttons: [
    {
      text: 'Cancel'
    },
    {
      text: 'OK',
      onClick: function() {
        mdui.alert('You clicked OK');
      }
    }
  ]
});
  1. Creating a responsive grid layout:
<div class="mdui-container">
  <div class="mdui-row">
    <div class="mdui-col-xs-12 mdui-col-sm-6 mdui-col-md-4">Column 1</div>
    <div class="mdui-col-xs-12 mdui-col-sm-6 mdui-col-md-4">Column 2</div>
    <div class="mdui-col-xs-12 mdui-col-sm-12 mdui-col-md-4">Column 3</div>
  </div>
</div>

Getting Started

To start using MDUI in your project, follow these steps:

  1. Include MDUI CSS and JavaScript files in your HTML:
<link rel="stylesheet" href="https://unpkg.com/mdui@1.0.2/dist/css/mdui.min.css">
<script src="https://unpkg.com/mdui@1.0.2/dist/js/mdui.min.js"></script>
  1. Use MDUI classes and components in your HTML:
<body class="mdui-theme-primary-indigo mdui-theme-accent-pink">
  <div class="mdui-appbar">
    <div class="mdui-toolbar mdui-color-theme">
      <span class="mdui-typo-title">My App</span>
    </div>
  </div>
  <div class="mdui-container">
    <h1 class="mdui-typo-display-1">Welcome to MDUI</h1>
    <button class="mdui-btn mdui-btn-raised mdui-ripple">Get Started</button>
  </div>
</body>
  1. Initialize MDUI components using JavaScript when needed:
document.addEventListener('DOMContentLoaded', function() {
  mdui.mutation();
});

Competitor Comparisons

A JavaScript library to position floating elements and create interactions for them.

Pros of Floating UI

  • More focused on positioning and layout algorithms
  • Highly customizable and flexible for various UI components
  • Actively maintained with frequent updates and improvements

Cons of Floating UI

  • Steeper learning curve for beginners
  • Requires more manual setup and configuration
  • Less comprehensive UI component library compared to MDUI

Code Comparison

MDUI (Material Design implementation):

<button class="mdui-btn mdui-btn-raised mdui-ripple">Button</button>

Floating UI (Positioning example):

import {computePosition, flip, shift, offset} from '@floating-ui/dom';

computePosition(button, tooltip, {
  middleware: [offset(6), flip(), shift({padding: 5})]
}).then(({x, y}) => {
  Object.assign(tooltip.style, {
    left: `${x}px`,
    top: `${y}px`,
  });
});

MDUI focuses on providing ready-to-use Material Design components, while Floating UI specializes in advanced positioning and layout algorithms for custom UI elements. MDUI offers a quicker setup for Material Design interfaces, whereas Floating UI provides more control over element positioning and interactions.

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.

Pros of Material-UI

  • Larger community and more extensive ecosystem
  • More comprehensive component library
  • Better TypeScript support and documentation

Cons of Material-UI

  • Larger bundle size and potentially slower performance
  • Steeper learning curve for beginners
  • More complex setup and configuration

Code Comparison

MDUI:

<div class="mdui-container">
  <button class="mdui-btn mdui-btn-raised mdui-ripple">Button</button>
</div>

Material-UI:

import { Button, Container } from '@mui/material';

<Container>
  <Button variant="contained">Button</Button>
</Container>

Key Differences

  • MDUI is lightweight and easy to use, while Material-UI offers more features and customization options
  • MDUI uses CSS classes for styling, whereas Material-UI uses a CSS-in-JS approach
  • Material-UI has better integration with React and other modern frameworks
  • MDUI is more suitable for simpler projects or those with performance constraints
  • Material-UI is better suited for large-scale applications with complex UI requirements

Both libraries implement Material Design principles, but Material-UI provides a more comprehensive solution for React-based projects, while MDUI offers a simpler, CSS-based approach that can be used with various frameworks or vanilla JavaScript.

39,623

🐉 Vue Component Framework

Pros of Vuetify

  • Larger community and ecosystem, with more resources and third-party integrations
  • More comprehensive component library, offering a wider range of UI elements
  • Better documentation and examples, making it easier for developers to get started

Cons of Vuetify

  • Heavier bundle size, which may impact performance for smaller projects
  • Steeper learning curve due to its extensive feature set and customization options
  • More opinionated design, which may require more effort to override default styles

Code Comparison

MDUI (HTML):

<div class="mdui-container">
  <button class="mdui-btn mdui-ripple">Button</button>
</div>

Vuetify (Vue.js):

<template>
  <v-container>
    <v-btn>Button</v-btn>
  </v-container>
</template>

Summary

Vuetify is a more feature-rich and widely adopted UI framework for Vue.js applications, offering a comprehensive set of components and extensive documentation. However, it comes with a larger bundle size and a steeper learning curve. MDUI, on the other hand, is a lighter-weight alternative with a focus on simplicity and ease of use, but it may lack some of the advanced features and community support found in Vuetify.

Materialize, a CSS Framework based on Material Design

Pros of Materialize

  • More mature and widely adopted, with a larger community and ecosystem
  • Offers a broader range of components and features out-of-the-box
  • Better documentation and examples for easier implementation

Cons of Materialize

  • Larger file size, which may impact page load times
  • Less frequent updates and maintenance compared to MDUI
  • More opinionated design, which may require more customization for unique projects

Code Comparison

MDUI:

<div class="mdui-container">
  <button class="mdui-btn mdui-ripple">Button</button>
  <div class="mdui-textfield">
    <input class="mdui-textfield-input" type="text" placeholder="Input"/>
  </div>
</div>

Materialize:

<div class="container">
  <a class="waves-effect waves-light btn">Button</a>
  <div class="input-field">
    <input id="input_text" type="text" class="validate">
    <label for="input_text">Input</label>
  </div>
</div>

Both frameworks offer similar Material Design-inspired components, but MDUI tends to have simpler class names and structure. Materialize provides more detailed classes for effects like waves and input validation. The choice between the two may depend on specific project requirements, desired customization level, and performance considerations.

Material Design Components in HTML/CSS/JS

Pros of Material Design Lite

  • Developed and maintained by Google, ensuring high-quality and adherence to Material Design principles
  • Lightweight and modular, allowing developers to use only the components they need
  • Extensive documentation and examples provided by Google

Cons of Material Design Lite

  • No longer actively maintained, with the last update in 2018
  • Limited set of components compared to more comprehensive frameworks
  • Less flexibility for customization and theming

Code Comparison

MDUI:

<button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent">
  Button
</button>

Material Design Lite:

<button class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent">
  Button
</button>

Summary

MDUI is a more actively maintained and feature-rich framework, offering a wider range of components and better customization options. It's particularly well-suited for developers working with Chinese language interfaces. Material Design Lite, while no longer actively maintained, still provides a solid foundation for implementing Material Design principles in web projects. Its lightweight nature and Google backing make it a good choice for simpler projects or those requiring minimal customization.

49,259

Modern CSS framework based on Flexbox

Pros of Bulma

  • Larger community and more widespread adoption, leading to better documentation and support
  • More comprehensive set of pre-built components and layout options
  • Easier to customize with Sass variables and mixins

Cons of Bulma

  • Larger file size, which may impact page load times
  • Less focus on mobile-first design compared to MDUI
  • Steeper learning curve for beginners due to more extensive class system

Code Comparison

MDUI (CSS):

.mdui-btn {
  display: inline-block;
  padding: 0 16px;
  line-height: 36px;
  text-align: center;
  color: inherit;
  background-color: transparent;
  border: none;
  cursor: pointer;
}

Bulma (CSS):

.button {
  -webkit-appearance: none;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 4px;
  box-shadow: none;
  display: inline-flex;
  font-size: 1rem;
  height: 2.5em;
  justify-content: flex-start;
  line-height: 1.5;
  padding-bottom: calc(0.5em - 1px);
  padding-left: calc(0.75em - 1px);
  padding-right: calc(0.75em - 1px);
  padding-top: calc(0.5em - 1px);
  position: relative;
  vertical-align: top;
}

Both frameworks offer CSS-based component styling, but Bulma's approach is more detailed and comprehensive, while MDUI's is simpler and more concise.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

mdui logo

mdui

A Material Design 3 (Material You) library of Web Components.
https://www.mdui.org

npm version CSS gzip size JS gzip size downloads license


  • 🧩 Works with all frameworks
  • 🚛 Works with CDNs
  • 🏙️ Material 3 design system
  • 🌛 Includes dark theme and dynamic color
  • 🆚 Optimized for WebStorm and VSCode
  • 😸 Open source

Docs

Installation

npm install mdui --save

Usage

Import CSS and JS:

import 'mdui/mdui.css';
import 'mdui';

Use the component:

<mdui-button>Button</mdui-button>

Using CDN

<!doctype html>
<html>
  <head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="https://unpkg.com/mdui@2/mdui.css">
    <script src="https://unpkg.com/mdui@2/mdui.global.js"></script>
  </head>
  <body>
    <mdui-button>Hello, world!</mdui-button>
  </body>
</html>

License

MIT

NPM DownloadsLast 30 Days