@focusinlab/tile
v3.0.0
Published
Customizable aspect ratio component
Downloads
1
Readme
tile
Tile customizable basic component
Install
npm install --save @focusinlab/tile
Props:
| Attribute | Required | Type | Default | | ---------- | -------- | -------------------------------------------- | ------- | | children | Yes | React Element | string | | | as | No | String | div | | ratio | No | "cube","cubeDouble", "cubeFull", "rectangle" | "cube" |
Usage
const BlueTile = () => {
return (
<Tile
ratio='cube'
data-test-id="my-blue-tile"
>
<label className="foo">click me</label>
</Tile>
)
}
Creating an "anchor" box
const ClickableTile = () => {
return (
<Tile
ratio='cube'
type='a'
onClick={clickHandler}
data-test-id="my-clickable-tile"
>
<label className="foo">click me</label>
</Tile>
)
}
License
MIT © focus-in-lab