🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

@chakra-ui/clickable

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
c

@chakra-ui/clickable

React hook and component that implements native button interactions

2.1.0
latest
100

Supply Chain Security

100

Vulnerability

81

Quality

77

Maintenance

100

License

Version published
Weekly downloads
489K
-0.04%
Maintainers
2
Weekly downloads
 
Created
Issues
7

@chakra-ui/clickable

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

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

Installation

import { useClickable } from "@chakra-ui/clickable"

Usage

// create a clickable primitive
const Clickable = (props) => {
  const clickable = useClickable(props)
  return <chakra.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>
)

FAQs

Package last updated on 18 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts