@anypoint-web-components/anypoint-button
TypeScript icon, indicating that this package has built-in type declarations

1.2.4 • Public • Published

Deprecated

This component has been moved to anypoint-web-components/awc.

====

Anypoint and Material Design styled button.

Anypoint button by default is styled for Anypoint platform. Styles can be controlled by using emphasis property ans CSS variables.

emphasis can be one of low, middle, or high. Styles for each of it can be redefined using CSS variables. Low emphasis button should be used for less important actions. Medium emphasis should be used for secondary actions. High emphasis should be used for primary action, not very often, ideally one per screen.

Published on NPM

tests

Usage

Installation

npm install @anypoint-web-components/anypoint-button --save

In a HTML document

<script type="module" src="@anypoint-web-components/anypoint-button/anypoint-button.js"></script>
<script type="module" src="@anypoint-web-components/anypoint-button/anypoint-icon-button.js"></script>

<anypoint-button emphasis="low">Low emphasis</anypoint-button>
<anypoint-button emphasis="medium">Medium emphasis</anypoint-button>
<anypoint-button emphasis="high">High emphasis</anypoint-button>
<anypoint-button toggles>Button that toggles</anypoint-button>
<anypoint-button disabled>You can't click me</anypoint-button>

<anypoint-icon-button emphasis="low">
  <my-icon icon="alarm-add"></my-icon>
</anypoint-icon-button>

In a LitElement

import { LitElement, html } from 'lit-element';
import '@anypoint-web-components/anypoint-button/anypoint-button.js';
import '@anypoint-web-components/anypoint-button/anypoint-icon-button.js';

class SimpleElement extends LitElement {
  render() {
    return html`
    <anypoint-button emphasis="low">Low emphasis</anypoint-button>
    <anypoint-button emphasis="medium">Medium emphasis</anypoint-button>
    <anypoint-button emphasis="high">High emphasis</anypoint-button>
    <anypoint-button toggles>Button that toggles</anypoint-button>
    <anypoint-button disabled>You can't click me</anypoint-button>

    <anypoint-icon-button emphasis="low">
      <my-icon icon="alarm-add"></my-icon>
    </anypoint-icon-button>
    `;
  }
}
window.customElements.define('simple-element', SimpleElement);

Development

git clone https://github.com/anypoint-web-components/anypoint-button
cd anypoint-button
npm install

Running the demo locally

npm start

Running the tests

npm test

Package Sidebar

Install

npm i @anypoint-web-components/anypoint-button

Weekly Downloads

821

Version

1.2.4

License

Apache-2.0

Unpacked Size

41.7 kB

Total Files

20

Last publish

Collaborators

  • jarrodek
  • twoplustwoone
  • lbauret
  • carowright