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

1.0.1 • Public • Published

Descent-Ripple

A highly customizable javascrip ripple animation for buttons. Made with Svelte, but easily usable with other frameworks.

Examples and usage

Getting started

Install the package from npm:

npm install descent-ripple

In Svelte you can easily use actions:

// MyButton.tsx
import React from 'react';
import ripple from 'descent-ripple';

export const MyButton = ()=>{
    const buttonRef = React.useRef<Node>(null);
     React.useEffect(()=>{
        if (buttonRef.current){
            let rippleOptions={};
            const buttonRipple = ripple(buttonRef.current,rippleOptions);
            return buttonRipple.destroy;
            
        }
    },[]);
    return (
        <button ref={buttonRef}>click me</button>
    )
}

For other frameworks see this blog post.

Dependents (1)

Package Sidebar

Install

npm i descent-ripple

Weekly Downloads

2

Version

1.0.1

License

none

Unpacked Size

42.5 kB

Total Files

6

Last publish

Collaborators

  • micha-lmxt