0.1.1 • Published 3 years ago

@evergreen-wc/eve-button v0.1.1

Weekly downloads
12
License
Apache-2.0
Repository
github
Last release
3 years ago

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

PropertyDescription
sizeSet size of button. e.g. xs, sm, md, lg
hrefSet an anchor to navigate to on click
onClickSet a function to callback on click
styleSet 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
0.1.0

3 years ago

0.1.1

3 years ago

0.0.9

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago