ilokesto

Hoverable

Hoverable tracks hover state and passes isHovering to a render prop. Forwards ref to the underlying div.

import { Hoverable } from '@ilokesto/utilinent';

<Hoverable>{(isHovering) => <Card highlighted={isHovering} />}</Hoverable>

Props

PropTypeDescription
childrenReactNode | (isHovering) => ReactNodeContent, optionally receiving hover state.
fallbackReactNodeRendered alongside children when not using a render prop.

All standard div props and ref are forwarded.

On this page