Socket
Socket
Sign inDemoInstall

@material/react-ripple

Package Overview
Dependencies
11
Maintainers
13
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @material/react-ripple

Material Components React Ripple


Version published
Weekly downloads
16K
increased by20.49%
Maintainers
13
Install size
1.02 MB
Created
Weekly downloads
 

Changelog

Source

0.4.2 (2018-08-14)

<a name="0.4.1"></a>

Readme

Source

React Ripple

A React version of an MDC Ripple.

Installation

npm install @material/react-ripple

Usage

Styles

with Sass:

import '@material/react-ripple/index.scss';

with CSS:

import '@material/react-ripple/dist/ripple.css';

Javascript Instantiation

To wrap a component with the ripple HOC, please follow this example:

import withRipple from '@material/react-ripple';

const Icon = (props) => {
  const {
    children,
    className = '',
    // call `initRipple` from the root element's ref. This attaches the ripple
    // to the element.
    initRipple,
    // include `unbounded` to remove warnings when passing `otherProps` to the
    // root element.
    unbounded,
    ...otherProps
  } = props;

  // any classes needed on your component needs to be merged with
  // `className` passed from `props`.
  const classes = `ripple-icon-component ${className}`;

  return (
    <div
      className={classes}
      ref={initRipple}
      {...otherProps}>
      {children}
    </div>
  );
};

const RippleIcon = withRipple(Icon);

Wrap your Icon component with the HOC withRipple, which returns a component with a ripple capable surface.

Props

Prop NameTypeDescription
unboundedbooleanRipple is unbounded if true.
disabledn/aDisables ripple if true.
styleobjectInline styles of root element.
classNamestringClasses to appear on className attribute of root element.

Sass Mixins

Sass mixins may be available to customize various aspects of the components. Please refer to the MDC Web repository for more information on what mixins are available, and how to use them.

Advanced Sass Mixins

Keywords

FAQs

Last updated on 14 Aug 2018

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc