Skip to content

Latest commit

 

History

History
49 lines (40 loc) · 1.11 KB

Hover.mdx

File metadata and controls

49 lines (40 loc) · 1.11 KB
name menu
Hover
2. Feedback Containers

import { Props, Prop, ChildrenProps, ChildrenProp } from '../_ui/PropsTable' import { Hover } from '../../dist/react-powerplug.esm'

Hover

The Hover component is used to known when user is hovering some element.
It's the same as :hover pseudo selector from css.

import { Hover } from 'react-powerplug'
<Hover>
  {({ hovered, bind }) => (
    <div {...bind}>
      You are {hovered ? 'hovering' : 'not hovering'} this div.
    </div>
  )}
</Hover>

Props

The onChange event of the Hover is called whenever the `hovered` state changes. Receive state as function. It can also be `render` prop.

Children Props

True if is hovering the binded element There are the bind event functions.
Contains `onMouseEnter` and `onMouseLeave` event listeners.