0.1.2 • Published 2 years ago

solid-long-press v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

solid-long-press

Expose long press event on any element or component.

Quick start

Install it:

pnpm add solid-long-press // or npm or yarn

Use it:

import longPress from 'solid-long-press';

const App = () => {
  const onLongPressStart = () => {
    // triggers after 300ms of mousedown
  };

  const onLongPressStop = () => {
    // triggers on mouseup of document
  };

  return (
    <div>
      <button
        use:longPress={300}
        oncapture:LongPressStart={onLongPressStart}
        oncapture:LongPressStop={onLongPressStop}
      >
        Click and Hold for 300ms
      </button>
    </div>
  );
};

License

MIT

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago