0.1.0 • Published 5 years ago

@alexseitsinger/react-hoverable-container v0.1.0

Weekly downloads
-
License
BSD-2-Clause
Repository
github
Last release
5 years ago

HoverableContainer

Extends React.Component

A container that has a mouseEnter and mouseLeave event handler.

Parameters

  • props object
    • props.onMouseEnter function The function to invoke when the mouse enters the container.
    • props.onMouseLeave function The function to invoke when the mouse leaves the container.
    • props.onMouseEnterDelay number? The number of milliseconds to wait before invoking onMouseEnter.
    • props.onMouseLeaveDelay number? The number of milliseconds to wait before invoking onMouseLeave.
    • props.containerStyle object? Extra css styles to apply to the container.
    • props.delay number The number of milliseconds to wait for both mouse events. (optional, default 300)

Examples

import { HoverableContainer } from
"@alexseitsinger/react-hoverable-container"

const App = ({ onMouseEnter, onMouseLeave, ... }) => {
  return (
    <HoverableContainer
      onMouseEnter={onMouseEnter}
      onMouseLeave={onMouseLeave}>
      <div>Some other content</div>
    </HoverableContainer>
  )
}

Returns function A component