2.0.3 • Published 2 years ago

material-ripple-button v2.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

material-ripple-button

React Ripple Button

Description

React Ripple Button is similar to Material Design Button and may be used in standalone React applications or in conjunction with a CSS framework such as TailwindCSS.

Material Ripple Button!

Installation

pnpm add material-ripple-button

or

yarn add material-ripple-button

or

npm install material-ripple-button

Usage

import RippleButton from 'material-ripple-button';

const MyComponent = () => {
    return <>
        {/* ... */}
        <RippleButton>This is a ripple button</RippleButton>
    </>
}

Properties

ProperySupported
Default attributesYES

Note: Disable ripple and turn it into normal button by adding attribute data-noripple

You can use any attribute, these will be completely passed directly into the <button> tag

Example

import RippleButton from "material-ripple-button";

export default function Home() {
	return (
		<>
			{/* Other code */}
			<RippleButton className="mt-5 p-2 text-red-500">Hello</RippleButton>
		</>
	);
}

Ripple Button!

On Focus

When the button is focused, the ripple effect also appears but has a different behavior, and either disappears after a few seconds or disappears immediately when it is pressed/touched (mousedown/touchstart).

On Focus

Ripple Color

The color of ripple is based on the color of the button's attribute in the order of precedence as follows:

OrderAttributeColor Level (r+g+b)Behavior
1background-color> 385.5darker
background-color<= 385.5lighter
2border-color> 385.5lighter
border-color<= 385.5darker
3color> 385.5lighter
color<= 385.5darker
4defaultlighter of rgb(33, 150, 243)
2.0.3

2 years ago

2.0.8

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago