Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@material/mwc-button
Advanced tools
> IMPORTANT: The Material Web Components are a work in progress and subject to > major changes until 1.0 release.
<mwc-button>
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
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.
<mwc-button label="standard"></mwc-button>
<mwc-button label="standard" icon="code"></mwc-button>
<mwc-button outlined label="outlined"></mwc-button>
<mwc-button outlined label="outlined" icon="code"></mwc-button>
<mwc-button raised label="raised"></mwc-button>
<mwc-button raised label="raised" icon="code"></mwc-button>
<mwc-button unelevated label="unelevated"></mwc-button>
<mwc-button unelevated label="unelevated" icon="code"></mwc-button>
<mwc-button dense unelevated label="dense"></mwc-button>
<mwc-button dense unelevated label="dense" icon="code"></mwc-button>
<mwc-button label="trailing icon" icon="code" trailingIcon></mwc-button>
<mwc-button disabled label="disabled"></mwc-button>
<mwc-button disabled label="disabled" icon="code"></mwc-button>
mwc-button {
--mdc-theme-primary: #e9437a;
--mdc-theme-on-primary: white;
}
None
Name | Type | Default | Description |
---|---|---|---|
icon | string | '' | Icon to display, and aria-label value when label is not defined. |
label | string | '' | Label to display for the button, and aria-label . |
raised | boolean | false | Creates a contained button that is elevated above the surface. |
unelevated | boolean | false | Creates a contained button that is flush with the surface. |
outlined | boolean | false | Creates an outlined button that is flush with the surface. |
dense | boolean | false | Makes the button text and container slightly smaller. |
disabled | boolean | false | Disabled buttons cannot be interacted with and have no visual interaction effect. |
trailingIcon | boolean | false | When true , icon will be displayed after label . |
None
None
Name | Default | Description |
---|---|---|
--mdc-icon-font | Material Icons | Font to use for the icon. |
--mdc-theme-primary | #6200ee | Background color of the button. |
--mdc-theme-on-primary | #ffffff | Text color of the button. |
--mdc-button-text-transform | uppercase | text-transform on the button label. |
--mdc-button-letter-spacing | 0.0892857143em | letter-spacing on the button label. |
--mdc-button-horizontal-padding | filled: 16px outlined: 15px default: 8px | Left and right padding of the button label (for outlined buttons the outline width is automatically subtracted). |
--mdc-button-outline-width | 1px | width of the outline of an outlined button and attempts to keep the component size constant. |
--mdc-button-outline-color | --mdc-theme-primary | Color of the outline of an outlined element. (Overrides --mdc-theme-primary ) |
--mdc-button-disabled-fill-color | rgba(0,0,0,0.12) | Background fill color of a disabled raised or unelevated button. |
--mdc-button-disabled-ink-color | rgba(0,0,0,0.37) | Text color of a disabled button as well as the outline color of a disabled outlined button. |
--mdc-button-disabled-outline-color | --mdc-button-disabled-ink-color | Sets the color of the outline of a disabled outlined button. (Overrides --mdc-button-disabled-ink-color ) |
FAQs
Material Design button web component
The npm package @material/mwc-button receives a total of 10,143 weekly downloads. As such, @material/mwc-button popularity was classified as popular.
We found that @material/mwc-button demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 15 open source maintainers collaborating on the project.
Did you know?
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.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.