@hig/behaviors
v2.1.0
Published
Shared component behaviors
Downloads
1,736
Readme
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>