0.0.2 • Published 1 year ago

@a2000/icon-button v0.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Button

Quick Start

  1. Begin by installing with your favourite package manager:

npm install @a2000/icon-button

  1. Use within your HTML templates as follows:
<!DOCTYPE html>
<html>
  <head>
    <title>Quick Start</title>
    <meta charset="UTF-8" />
  </head>

  <body>
    <!-- Use web components in your HTML like regular built-in elements. -->
    <a2k-icon-button icon="help-icon" text="About"></a2k-icon-button>

    <!-- a2k web components use standard JavaScript modules. -->
    <script type="module">
      import "@a2000/button/a2k-icon-button.js";

      const aboutIcon = document.querySelector(
        'a2k-icon-button[icon="help-icon"]'
      );

      aboutIcon.onOpen = () => {
        console.log("I've been double clicked");
      };
    </script>
  </body>
</html>

API

Props

NameTypeDefault Value
iconstring""
textstring""

Events

NameDescription
onOpenThe callback that fires when the user double clicks the button