0.3.0-alpha.bb03e5a8 • Published 7 years ago

@crave/farmblocks-hoc-withtooltip v0.3.0-alpha.bb03e5a8

Weekly downloads
190
License
MIT
Repository
github
Last release
7 years ago

Farmblocks HOC-withTooltip

A Higher Order Component that handles Farmblocks-Tooltip visibility.

Installation

npm install @crave/farmblocks-hoc-withtooltip

Usage

This HOC takes as argument a component or HTML element which will work as a trigger for a tooltip, firing its visibility when onMouseOver, and hiding it onMouseLeave.

import React, { Component } from 'react';
import { render } from 'react-dom';
import withTooltip from '@crave/farmblocks-hoc-withTooltip'

const InputWithTooltip = withTooltip("input");

const App = props => (
  <div>
    <InputWithTooltip tooltipContent="This is the text rendered inside the tooltip" />
  </div>
);

render(<App />, document.getElementById('root'));

API

PropertyTypeDefaultDescription
disableTooltipbooleanfalsedisables tooltip rendering
tooltipContentstring or PropTypes.nodecontent to be rendered inside the tooltip. If empty, the tooltip will not be rendered
alignstring, one of "left", "right", "center" or "auto"leftcontrols tooltip alignment
zIndexnumber1000z-index value
bondariesSelectorstring(only for align="auto") A CSS selector for a container which will define the limits for the tooltip. If not defined, the limit will be the browser's viewport
hideArrowbooleanfalsecontrols arrow visibility
paddingstring8pxcontent padding
topstring15pxdistance from the top of the container to the tip
overflowstringoverrides the default overflow property.
onMouseOverfunctionfunction to be run when the mouse enters the trigger component
onMouseLeavefunctionfunction to be run when the mouse leaves the trigger component

License

MIT

1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

7 years ago

1.2.4

7 years ago

1.2.3

7 years ago

1.2.3-alpha.9

7 years ago

1.2.3-4211.1.8

7 years ago

1.2.3-4212.1.8

7 years ago

1.2.3-4209.1.8

7 years ago

1.2.3-4208.1.8

7 years ago

1.2.2

7 years ago

1.2.2-alpha.26

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.2-alpha.1

7 years ago

1.1.1

7 years ago

1.1.1-alpha.13

7 years ago

1.1.1-alpha.12

7 years ago

1.1.0

7 years ago

1.0.11-alpha.4

7 years ago

1.0.11-alpha.9

7 years ago

1.0.11-alpha.7

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago