1.1.13 • Published 1 month ago
@leafygreen-ui/ripple v1.1.13
Ripple
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
Argument | Type | Description | Default |
---|---|---|---|
ref | HTMLElement | HTMLElement that ripple effect should be applied to | |
options | Options that specify coloring and size of ripple | ||
options.variant | 'primary' , 'info' , 'default' , 'danger' , 'secondaryDanger' | Determines color of ripple effect | |
options.darkMode | boolean | Determines if the ripple effect will be rendered in dark mode | false |
NOTE: In order for this to work as expected, the target element must have the property overflow:hidden
set
1.1.13
1 month ago
2.0.0-alpha.0
10 months ago
2.0.0-alpha.1
10 months ago
1.1.12
9 months ago
1.1.11
9 months ago
1.1.10
10 months ago
1.1.9
1 year ago
1.1.8
1 year ago
1.1.7
1 year ago
1.1.6
1 year ago
1.1.5
2 years ago
1.1.4
2 years ago
1.1.4-next.2
2 years ago
1.1.4-next.0
2 years ago
1.1.4-next.1
2 years ago
1.1.4-test.0
2 years ago
1.1.3
2 years ago
1.1.2
3 years ago
1.1.1
3 years ago
1.1.0
3 years ago
1.0.0
3 years ago