Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@material/mwc-button

Package Overview
Dependencies
Maintainers
17
Versions
720
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@material/mwc-button

> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.

  • 0.10.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
17
Created
Source

<mwc-button> Published on npm

IMPORTANT: The Material Web Components are a work in progress and subject to major changes until 1.0 release.

Buttons allow users to take actions, and make choices, with a single tap.

Material Design Guidelines: Button

Installation

npm install @material/mwc-button

NOTE: The Material Web Components are distributed as ES2017 JavaScript Modules, and use the Custom Elements API. They are compatible with all modern browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional tooling step is required to resolve bare module specifiers, as well as transpilation and polyfills for Edge and IE11. See here for detailed instructions.

Example Usage

Standard

<mwc-button label="standard"></mwc-button>
<mwc-button label="standard" icon="code"></mwc-button>

Outlined

<mwc-button outlined label="outlined"></mwc-button>
<mwc-button outlined label="outlined" icon="code"></mwc-button>

Raised

<mwc-button raised label="raised"></mwc-button>
<mwc-button raised label="raised" icon="code"></mwc-button>

Unelevated

<mwc-button unelevated label="unelevated"></mwc-button>
<mwc-button unelevated label="unelevated" icon="code"></mwc-button>

Dense

<mwc-button dense unelevated label="dense"></mwc-button>
<mwc-button dense unelevated label="dense" icon="code"></mwc-button>

Trailing Icon

<mwc-button label="trailing icon" icon="code" trailingIcon></mwc-button>

Disabled

<mwc-button disabled label="disabled"></mwc-button>
<mwc-button disabled label="disabled" icon="code"></mwc-button>

Customize Colors

mwc-button {
  --mdc-theme-primary: #e9437a;
  --mdc-theme-on-primary: white;
}

API

Slots

None

Properties/Attributes

NameTypeDefaultDescription
iconstring''Icon to display, and aria-label value when label is not defined.
labelstring''Label to display for the button, and aria-label.
raisedbooleanfalseCreates a contained button that is elevated above the surface.
unelevatedbooleanfalseCreates a contained button that is flush with the surface.
outlinedbooleanfalseCreates an outlined button that is flush with the surface.
densebooleanfalseMakes the button text and container slightly smaller.
disabledbooleanfalseDisabled buttons cannot be interacted with and have no visual interaction effect.
trailingIconbooleanfalseWhen true, icon will be displayed after label.

Methods

None

Events

None

CSS Custom Properties

NameDefaultDescription
--mdc-icon-fontMaterial IconsFont to use for the icon.
--mdc-theme-primary #6200eeBackground color of the button
--mdc-theme-on-primary #ffffffText color of the button

Additional references

FAQs

Package last updated on 11 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc