Socket
Socket
Sign inDemoInstall

@leafygreen-ui/ripple

Package Overview
Dependencies
1
Maintainers
5
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @leafygreen-ui/ripple

leafyGreen UI Kit Ripple


Version published
Weekly downloads
16K
decreased by-39.38%
Maintainers
5
Install size
2.09 MB
Created
Weekly downloads
 

Readme

Source

Ripple

npm (scoped)

Installation

Yarn

yarn add @leafygreen-ui/ripple

NPM

npm install @leafygreen-ui/ripple

Example

import { registerRipple } from '@leafygreen-ui/ripple';

// JavaScript Example
const button = document.querySelector('#my-button');
const buttonOptions = {
  variant: 'danger',
  darkMode: false,
};

registerRipple(button, buttonOptions);

// React Example
function Button({ options }) {
  const ref = React.useRef(null);

  useEffect(() => {
    if (ref.current) {
      registerRipple(ref, options);
    }
  }, [ref, options]);
}

Arguments

ArgumentTypeDescriptionDefault
refHTMLElementHTMLElement that ripple effect should be applied to
optionsOptions that specify coloring and size of ripple
options.variant'primary', 'info', 'default', 'danger', 'secondaryDanger'Determines color of ripple effect
options.darkModebooleanDetermines if the ripple effect will be rendered in dark modefalse

NOTE: In order for this to work as expected, the target element must have the property overflow:hidden set

FAQs

Last updated on 26 Mar 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc