![Bundle size](https://badgen.net/bundlephobia/minzip/clickable-box?label=gzip%20size)
ClickableBox
Problem: It's very hard to remove all styles from HTML button
elements.
It's also hard to create clickable div
s that are accessible.
Solution: The ClickableBox
component allows you to add onClick
to HTML elements without sacrificing accessibility.
Install
You can install ClickableBox
with NPM or Yarn.
npm install clickable-box --save-exact
yarn add clickable-box --exact
We encourage pinning the version number until ClickableBox
reaches 1.0.0
. We may ship breaking changes in 0.x.x
versions.
Props
There are a few props that are built into ClickableBox
:
prop | type | description |
---|
onClick | function | required | The action to perform when the element is pressed |
is | string , React.Element | defaults to: div | The element to render |
ref | React.Ref | Provides access to the React element |
You can pass any custom prop as well since this component spreads all of the props on the rendered element.