1.0.2 • Published 6 years ago
@mmgj/react-invisibutton v1.0.2
@mmgj/react-invisibutton
Accessible yet invisible wrapper for blinged out clickables
Wraps a DOM element in <button> tags stripped of all visible styles.
Install
npm i @mmgj/react-invisibutton
or
yarn add @mmgj/react-invisibutton
Usage
import InvisiButton from '@mmgj/react-invisibutton';
...
<InvisiButton onClick={clickHandler}>
<div style={{ /* Crazy stuff here */}}> Click me!</div>
</InvisiButton>
Props
Prop | Type | Default | Description |
---|---|---|---|
onClick | func | () => false; | Click handler |
children | node | *required* | Any renderable element |
style | object | {} | Styles for the button element |
type | 'button', 'submit' or 'reset' | 'button' | Override the button type |
className | 'string' | '' | Additional classes for button element 1 |
1 The button element ships with the class name invisibutton__reset
by default. I really hope this isn't your favorite class name.