# @bianic-ui/clickable

> React hook and component that implements native button interactions

Latest version **0.1.0-alpha.2** (published 2020-09-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @bianic-ui/clickable
pnpm add @bianic-ui/clickable
yarn add @bianic-ui/clickable
bun add @bianic-ui/clickable
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0-alpha.2 |
| Published | 2020-09-03 |
| First published | 2020-09-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 80.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Muhammad Rafiul Ilmi Syarifudin |
| Maintainers | ilmimris |
| Keywords | bianic ui, clickable, tabbable, button, div button |

## Links

- npm: https://www.npmjs.com/package/@bianic-ui/clickable
- Repository: https://gitlab.com/bia-design/bianic-ui
- Homepage: https://gitlab.com/bia-design/bianic-ui#readme
- Issues: https://gitlab.com/bia-design/bianic-ui/issues
- npm.io page: https://npm.io/package/@bianic-ui/clickable

## Dependencies (1)

- [@bianic-ui/utils](https://npm.io/package/@bianic-ui/utils.md) ^0.1.0-alpha.2

## Recent versions

- 0.1.0-alpha.2 (latest) — 2020-09-03
- 0.1.0-alpha.1 — 2020-09-03

## README

# @bianic-ui/clickable

React hook that implements all the interactions of a native `button` component
with support for making it focusable even if it's disabled.

It can be used with both native button elements or other elements (like `div`).

## Installation

```jsx
import { useClickable } from "@bianic-ui/clickable"
```

## Usage

```jsx
// create a clickable primitive
const Clickable = (props) => {
  const clickable = useClickable(props)
  return <bianic.button display="inline-flex" {...clickable} />
}

// use the clickable primitive
const Example = () => (
  <Clickable
    as="div"
    onClick={(event) => {
      alert("clicked")
    }}
    _active={{ bg: "blue", color: "white" }}
    _disabled={{ opacity: 0.4, pointerEvents: "none" }}
  >
    Clickable
  </Clickable>
)
```

---
_Source: https://npm.io/package/@bianic-ui/clickable · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
