Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@leafygreen-ui/ripple

Package Overview
Dependencies
Maintainers
4
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leafygreen-ui/ripple

leafyGreen UI Kit Ripple

  • 1.1.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16K
decreased by-57.65%
Maintainers
4
Weekly downloads
 
Created
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

Package last updated on 04 Oct 2022

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc