@evergreen-wc/eve-button

0.1.1 • Public • Published

eve-button

An Evergreen Button Web Component

Demo

Install

npm i @evergreen-wc/eve-button

Usage

import { html, LitElement } from 'lit';
import '@evergreen-wc/eve-button';

class MyComponent extends LitElement {
  handleClick() {
    alert('button clicked!');
  }

  render() {

    const style = `
    :host .btn {
      color: white;
      background-color: red;
    }
    :host .btn:hover {
      color: red;
      background-color: white;
    }`;

    return html`
      <eve-button size="md" href="/docs" style="${style}">Medium href Button</eve-button>
      <eve-button size="md" .onClick="${this.handleClick.bind(this)}">Medium function Button</eve-button>
    `;
  }
}

Props

Property Description
size Set size of button. e.g. xs, sm, md, lg
href Set an anchor to navigate to on click
onClick Set a function to callback on click
style Set a custom stylesheet for a specific button

Styling

--primary-color: #007f1d;
--secondary-color:#fff;
--btn-background: transparent;
--btn-border-color: var(--primary-color);
--btn-text-color: var(--primary-color);
--btn-hover-background-color: var(--primary-color);
--btn-hover-text-color: var(--secondary-color);
--btn-hover-border-color: var(--primary-color);
--btn-border-radius: 5px

Readme

Keywords

none

Package Sidebar

Install

npm i @evergreen-wc/eve-button

Weekly Downloads

7

Version

0.1.1

License

Apache-2.0

Unpacked Size

15.4 kB

Total Files

5

Last publish

Collaborators

  • hutchgrant