Skip to content

clshortfuse/materialdesignweb

Repository files navigation

materialdesignweb

Material Design for Web

A standards-focused, zero-dependency implemention of Material Design 3 (Material You).

Version License MinZip Dependents

Demo

https://clshortfuse.github.io/materialdesignweb/

Getting started

Pre-bundled

<script type="module"
  src="https://cdn.jsdelivr.net/npm/@shortfuse/materialdesignweb?color=6750A4"></script>

<mdw-button>Hello World!</mdw-button>

Includes all components and theming over URL params.

Development

Static Theme Generation:

npx -p @shortfuse/materialdesignweb mdw-css --color=color=6750A4 --custom=yellow,orange:orange,green:0f0,alias:aqua --lightness=auto > theme.css

Dynamic Theme Generation:

See loader.js for an example.

Component Loading

import { Button } from '@shortfuse/materialdesignweb';
// OR
import Button from '@shortfuse/materialdesignweb/components/Button.js';
// OR
import Button from 'https://www.unpkg.com/@shortfuse/materialdesignweb/components/Button.js';
// OR
import { Button } from 'https://cdn.jsdelivr.net/npm/@shortfuse/materialdesignweb?color=6750A4';

const button = new Button();
button.textContent = 'Hello World!';
document.body.append(button);

Support

Compatibility is kept for as long possible by including browser-version-based patches. Ultimately, compatiblity may be dropped as new features get added. Bugs present in supported browsers should always be fixed.

Feature Chrome Edge Firefox Safari
ShadowRoot 53 79 63 10
WeakRef 84 84 79 14.1
:where() 88 88 78 14
Array.at† 92 92 90 15.4
replaceChildren† 84 86 79 14.1
ElementInternals† 77 79 93 16.4
delegatesFocus† 53 79 94 15
AdoptedStyleSheets* 73 79 101 16.4
CSS container queries* 106 106 110 16.0
Compatibility 88 88 78 16.4
Support Latest ChromeOS LTS Release Microsoft Edge Extended Stable Channel ESR 115 Last 2 Versions
Status Chrome Edge Firefox Safari

*Optional

†Can be polyfilled

Notes:

  • Compatibility may be extended via polyfills (not included)

Components

Component Features Status Size
Badge πŸ–ŒοΈ πŸ–οΈ β­• πŸ…°οΈ πŸ”· πŸ“Ά βœ”οΈ Size
Bottom App Bar πŸ–ŒοΈ πŸ–οΈ β­• πŸ…°οΈ πŸ”· β™Ώ βœ”οΈ Size
Bottom Sheet πŸ“
Button πŸ–ŒοΈ πŸ–οΈ β­• πŸ…°οΈ πŸ”· πŸ“Ά β™Ώ βœ”οΈ Size
Card πŸ–ŒοΈ πŸ–οΈ β­• πŸ…°οΈ πŸ”· ↕️ β™Ώ βœ”οΈ Size
Fab πŸ–ŒοΈ πŸ–οΈ β­• πŸ…°οΈ πŸ”· πŸ“Ά β™Ώ βœ”οΈ Size
Fab - Extended πŸ–ŒοΈ πŸ–οΈ β­• πŸ…°οΈ πŸ”· πŸ“Ά β™Ώ βœ”οΈ Size
Icon Button πŸ–ŒοΈ πŸ–οΈ β­• πŸ…°οΈ πŸ”· πŸ“Ά β™Ώ βœ”οΈ Size
Segmented Button πŸ–ŒοΈ πŸ–οΈ β­• πŸ…°οΈ πŸ”· πŸ“Ά β™Ώ βœ”οΈ Size
Segmented Button Group πŸ–οΈ β™Ώ βœ”οΈ Size
Checkbox πŸ–ŒοΈ πŸ–οΈ πŸ…°οΈ πŸ”· β™Ώ βœ”οΈ Size Size
Chip πŸ–ŒοΈ πŸ–οΈ β­• πŸ…°οΈ πŸ”· πŸ“Ά β™Ώ βœ”οΈ Size
Chip - Filter πŸ–ŒοΈ πŸ–οΈ β­• πŸ…°οΈ πŸ”· πŸ“Ά β™Ώ βœ”οΈ Size
Chip: Filter Dropdown 🚧
Chip: Input 🚧
Date Picker ❔
Dialog πŸ–ŒοΈ πŸ–οΈ β­• πŸ…°οΈ πŸ”· β™Ώ βœ”οΈ Size
Dialog: Full-screen ❔
Divider πŸ–οΈ βœ”οΈ Size
Icon πŸ–οΈ βœ”οΈ Size
List πŸ–ŒοΈ πŸ–οΈ πŸ“Ά β™Ώ βœ”οΈ Size Size
Listbox πŸ–ŒοΈ πŸ–οΈ πŸ“Ά β™Ώ βœ”οΈ Size Size
Menu πŸ–ŒοΈ πŸ–οΈ β­• πŸ“Ά β™Ώ βœ”οΈ Size Size
Navigation Bar πŸ–ŒοΈ πŸ–οΈ β­• πŸ”· β™Ώ βœ”οΈ Size Size
Navigation Drawer πŸ–ŒοΈ πŸ–οΈ β­• πŸ”· β™Ώ 🚧 Size Size
Navigation Rail πŸ–ŒοΈ πŸ–οΈ β­• πŸ”· β™Ώ βœ”οΈ Size Size
Progress Indicators πŸ–οΈ β™Ώ βœ”οΈ Size
Search πŸ–ŒοΈ πŸ–οΈ β­• πŸ…°οΈ πŸ”· β™Ώ 🚧 Size
Radio πŸ–οΈ πŸ…°οΈ πŸ”· β™Ώ βœ”οΈ Size Size
Side Sheet 🚧
Slider πŸ–οΈ β™Ώ ⚠️ Size
Snackbar πŸ–ŒοΈ πŸ–οΈ β­• πŸ”· πŸ“Ά β™Ώ βœ”οΈ Size
Switch πŸ–ŒοΈ πŸ–οΈ πŸ…°οΈ β™Ώ βœ”οΈ Size Size
Tab πŸ–ŒοΈ πŸ–οΈ β­• πŸ”· β™Ώ βœ”οΈ Size Size Size Size
Text Input πŸ–ŒοΈ πŸ–οΈ β­• πŸ…°οΈ πŸ”· πŸ“Ά β™Ώ βœ”οΈ Size
Text Area πŸ–ŒοΈ πŸ–οΈ β­• πŸ…°οΈ πŸ”· πŸ“Ά β™Ώ βœ”οΈ Size
Text Select πŸ–ŒοΈ πŸ–οΈ β­• πŸ…°οΈ πŸ”· πŸ“Ά β™Ώ βœ”οΈ Size
Time Picker ❔
Tooltip πŸ–ŒοΈ πŸ–οΈ β­• πŸ”· β™Ώ βœ”οΈ Size
Top App Bar πŸ–ŒοΈ πŸ–οΈ β­• πŸ…°οΈ β™Ώ βœ”οΈ Size

Additional

Component Description Status Size
Box Simple themeable component with Flex and Grid options βœ”οΈ Size
Layout Manages page nav, and pane layouts 🚧 Size
Icon Font-icon, SVG, and IMG support 🚧 Size
Body Box with Body typography βœ”οΈ Size
Label Box with Label typography βœ”οΈ Size
Headline Box with Headline typography βœ”οΈ Size
Title Box with Title typography βœ”οΈ Size
Ripple Ripple effect βœ”οΈ Size
Shape Themeable, flexable, shapeable element βœ”οΈ Size
Surface Themeable, flexable, shapeable, elevateable element βœ”οΈ Size

Mixins

Mixin Description Status Size
AriaReflector Reflects ARIA Properties βœ”οΈ Size
AriaToolbar Shared ARIA Toolbar functionality βœ”οΈ Size
Control HTML Control wrapper βœ”οΈ Size
Density Component density options βœ”οΈ Size
Flexable Add flexbox options as attributes βœ”οΈ Size
FormAssociated Form-associated custom element support βœ”οΈ Size
Input HTMLInputElement wrapper βœ”οΈ Size
KeyboardNav Adds arrow key navigation and roving tab index ⚠️ Size
ResizeObserver Shared Eelement resize observer βœ”οΈ Size
Ripple Replaces pressed state with ripple effect βœ”οΈ Size
RTLObserver Shared RTL paoge observer βœ”οΈ Size
ScrollListener Listen for horizontal and vertical scroll events βœ”οΈ Size
Shape Adds shape and outline layer to elements ⚠️ Size
Surface Adds shadows to elements ⚠️ Size
TextField Shared text field functionality βœ”οΈ Size
TooltipTrigger Triggers tooltips based on events 🚧 Size
TouchTarget Adds extended touch target to controls 🚧 Size

Core

File Description Status Size
Composition Composes templates based on styles, fragments, and watches. Renders data 🚧 Size
CustomElement Handles ShadowDOM, ElementInternals, Property attributes, and compositions 🚧 Size
CompositionAdapter Handles data array to elements binding 🚧 Size
jsonMergePatch Applies, constructors, and evaluates JSON Merge Patch 🚧 Size
css CSS, CSSStyleSheet, HTMLStyleElement functions βœ”οΈ Size
customTypes Non-primitive observable types 🚧 Size
optimizations Micro-optimizations functions 🚧 Size
dom DOM functions ⚠️ Size
observe Observable pattern for primitives and objects 🚧 Size
template Template literals for CSS (CSSStyleSheet) and HTML (DocumentFragment) βœ”οΈ Size
uid Generates a UID string βœ”οΈ Size

Other Components

These components do not have official M3 guidelines

Component Status
Backdrop πŸ’€
Banner 🚧
Data Table πŸ“
Image List ❔

Legend

Archive

The Material Design 1/2 version has been archived in the archive-md2 branch.