npm.io
2.1.0 • Published 4 years ago

@hig/behaviors

Licence
Apache-2.0
Version
2.1.0
Deps
1
Size
19 kB
Vulns
0
Weekly
0
Stars
192

Behaviors

Shared component behaviors used across component

Getting started

yarn add @hig/behaviors

Import the component and CSS

import { HoverBehavior } from "@hig/behaviors";

Basic usage

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