npm.io
1.0.0 • Published 3 years ago

@weave-design/behaviors

Licence
Apache-2.0
Version
1.0.0
Deps
1
Size
16 kB
Vulns
0
Weekly
0
Stars
193

Behaviors

Shared component behaviors used across component

Getting started

yarn add @weave-design/behaviors

Import the component and CSS

import { HoverBehavior } from "@weave-design/behaviors";

Basic usage

<HoverBehavior>
  {({ hasHover, onMouseEnter, onMouseLeave }) => (
    <span
      style={{ color: hasHover ? "red" : "white" }}
      onMouseEnter={onMouseEnter}
      onMouseLeave={onMouseLeave}
    >
      Hello World
    </span>
  )}
</HoverBehavior>