ripple-anything
TypeScript icon, indicating that this package has built-in type declarations

1.0.9 • Public • Published

ripple-anything.js

NPM Package Build Size

Add click ripple effect to any HTMLElement

just like material ui ripple, easy use, all browser supported, TypeScript supported

play on stackblitz

Demo

Usage

html

<script src="./dist/index.js"></script>
<div onclick="rippleAnything(event)">i am a button</div>

react

import rippleAnything from "./index";

const Com = () => <div
    onclick={(e) => {
        e.persist() // maybe need do this
        rippleAnything(e as unknown as MouseEvent)
    }}>
    i am a button
</div>

angular

<div (click)="rippleAnything($event)">i am a button</div>

vue

<template>
  <div @click="rippleAnything">i am a button</div>
</template>
<script>
import rippleAnything from "ripple-anything";

export default {
  methods: {
    rippleAnything
  }
}
</script>

Readme

Keywords

none

Package Sidebar

Install

npm i ripple-anything

Weekly Downloads

11

Version

1.0.9

License

ISC

Unpacked Size

9.17 kB

Total Files

8

Last publish

Collaborators

  • chenxiang123