@weave-design/behaviors
v1.0.0
Published
Shared component behaviors
Downloads
1,189
Readme
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>