@maaaashi/long-press-button
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Long Press Button

usage

Github repository containing the source code for Long Press Button Component

created by X@pg_maaaashi

Table of Contents

Usage

<!-- default -->
<long-press-button></long-press-button>
<!-- edit duration -->
<long-press-button duration=1000></long-press-button>
<!-- edit text -->
<long-press-button text="クリック" holding-text="Holding..."></long-press-button>

script src

<head>
  <script src="https://maaaashi.github.io/long-press-button/bundle.js"></script>
  <script>
  document.addEventListener('DOMContentLoaded', () => {
    const button = document.querySelector('long-press-button');
    button.onLongPress = () => alert('外部から渡された関数が実行されました!');
  });
</script>
</head>
<body>
  <long-press-button></long-press-button>
</body>

npm

$ npm install @maaaashi/long-press-button
import '@maaaashi/long-press-button'

const longPressButton = document.querySelector('long-press-button');
button.onLongPress = () => alert('外部から渡された関数が実行されました!');

<long-press-button></long-press-button>

Readme

Keywords

none

Package Sidebar

Install

npm i @maaaashi/long-press-button

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

105 kB

Total Files

5

Last publish

Collaborators

  • maaaashi