2.1.0 • Published 2 years ago

@hig/behaviors v2.1.0

Weekly downloads
35
License
Apache-2.0
Repository
github
Last release
2 years ago

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>