@crave/farmblocks-hoc-withtooltip

1.3.3 • Public • Published

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

Property Type Default Description
disableTooltip boolean false disables tooltip rendering
tooltipContent string or PropTypes.node content to be rendered inside the tooltip. If empty, the tooltip will not be rendered
align string, one of "left", "right", "center" or "auto" left controls tooltip alignment
zIndex number 1000 z-index value
bondariesSelector string (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
hideArrow boolean false controls arrow visibility
padding string 8px content padding
top string 15px distance from the top of the container to the tip
overflow string overrides the default overflow property.
onMouseOver function function to be run when the mouse enters the trigger component
onMouseLeave function function to be run when the mouse leaves the trigger component

License

MIT

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.3.4-alpha-tooltip-position-4886.1.190canary
1.3.30latest
1.2.3-4209.1.804209.1
1.2.3-4208.1.804208.1

Version History

VersionDownloads (Last 7 Days)Published
1.3.4-alpha-tooltip-position-4886.1.190
1.3.4-alpha-tooltip-position-4885.1.210
1.3.30
1.3.3-alpha-upd-deps-4827.1.210
1.3.3-alpha-upd-deps-4825.1.230
1.3.3-alpha-upd-deps-4809.1.190
1.3.20
1.3.2-alpha-text-truncate-4717.1.70
1.3.2-alpha-text-truncate-4715.1.60
1.3.2-alpha-text-truncate-4713.1.60
1.3.2-alpha-text-truncate-4709.1.40
1.3.10
1.3.1-alpha-modal-tweaks-4662.1.120
1.3.00
1.2.5-alpha-extendable.370
1.2.5-alpha-extendable.390
1.2.5-alpha-extendable.340
1.2.40
1.2.4-alpha-storybook-images.120
1.2.30
1.2.3-alpha-multi-select.250
1.2.3-alpha-multi-select.190
1.2.3-alpha-percy-andre.140
1.2.3-alpha-percy-andre.130
1.2.3-alpha.90
1.2.3-4211.1.80
1.2.3-4212.1.80
1.2.3-4209.1.80
1.2.3-4208.1.80
1.2.3-setup-percy.80
1.2.20
1.2.2-alpha.260
1.2.10
1.2.00
1.1.2-alpha.10
1.1.10
1.1.1-alpha.130
1.1.1-alpha.120
1.1.00
1.1.0-alpha.e40864c20
1.1.0-alpha.46063efc0
1.1.0-alpha.9772d56f0
1.0.11-alpha.40
1.1.0-alpha.d17918c60
1.1.0-alpha.d20ca3cc0
1.1.0-alpha.a89d5ae70
1.1.0-alpha.b56b77430
1.0.11-alpha.90
1.0.11-alpha.70
1.1.0-alpha.9eea1bd70
1.1.0-alpha.ce9dd01e1
1.1.0-alpha.522950491
1.0.100
1.1.0-alpha.b06c364f0
1.1.0-alpha.58cc129e1
1.1.0-alpha.140e89fc0
1.1.0-alpha.3152cff10
1.1.0-alpha.5ec967980
1.1.0-alpha.20dc03020
1.1.0-alpha.198f23311
1.1.0-alpha.7c5cc2230
1.1.0-alpha.b4f9d3251
1.1.0-alpha.4a16a3c20
1.1.0-alpha.7325588e0
1.1.0-alpha.8a98f83c0
1.1.0-alpha.2496656c0
1.1.0-alpha.a3d909460
1.1.0-alpha.09169fcc0
1.0.90
1.1.0-alpha.d9cb31b40
1.1.0-alpha.ebe764b91
1.0.80
1.1.0-alpha.b2379f6d0
1.0.70
1.1.0-alpha.6a8363d50
1.0.61
1.1.0-alpha.1c3402b50
1.1.0-alpha.cf417eeb0
1.1.0-alpha.d80190620
1.1.0-alpha.95d468341
1.1.0-alpha.21ea3e281
1.1.0-alpha.a45fca8d0
1.1.0-alpha.f82fd6b40
1.1.0-alpha.a66589241
1.1.0-alpha.5a5c4b6b0
1.1.0-alpha.f6b6d9920
1.1.0-alpha.e87ed3191
1.1.0-alpha.ee3ceaab0
1.1.0-alpha.e7623c670
1.1.0-alpha.a11b54b60
1.0.50
1.1.0-alpha.e03c646f0
1.1.0-alpha.d4c079550
1.1.0-alpha.e5a3180f0
1.1.0-alpha.dd5f74761
1.1.0-alpha.8657e05c0
1.1.0-alpha.2f7f30580
1.1.0-alpha.cdd341010
1.1.0-alpha.b2965f0b0
1.1.0-alpha.74f71aaa0
1.1.0-alpha.c6940d9e0
1.1.0-alpha.74cf6c510
1.1.0-alpha.6b2101dd0
1.1.0-alpha.6d6d14f70
1.0.40
1.1.0-alpha.f6da02190
1.1.0-alpha.e54fc0960
1.1.0-alpha.375d8a6c0
1.1.0-alpha.6bf4f5bb0
1.1.0-alpha.fadcd1990
1.1.0-alpha.83b4399c0
1.1.0-alpha.aa3b4b881
1.1.0-alpha.3bc2b88c0
1.1.0-alpha.e7c814430
1.1.0-alpha.6ae5d07a0
1.1.0-alpha.43e2e3a40
1.1.0-alpha.e1d3d9bd0
1.1.0-alpha.0251c33c0
1.1.0-alpha.9bff8ddb0
1.1.0-alpha.eddde3040
1.0.31
1.1.0-alpha.d2eda2b50
1.1.0-alpha.885812b60
1.1.0-alpha.3dfab5960
1.1.0-alpha.1b289e6a0
1.1.0-alpha.07e9f0120
1.1.0-alpha.e6e80ba70
1.1.0-alpha.8de25fab0
1.1.0-alpha.5af558160
1.1.0-alpha.9350a75e0
1.1.0-alpha.0c3e89c70
1.1.0-alpha.b9bb0fbf0
1.1.0-alpha.a407fc3d0
1.1.0-alpha.a3be0ff61
1.1.0-alpha.21d9064f1
1.1.0-alpha.21e267290
1.1.0-alpha.e97f538c0
1.1.0-alpha.875ee1960
1.1.0-alpha.c0aa2f9a0
1.1.0-alpha.ff6847aa0
1.1.0-alpha.cb5396650
1.1.0-alpha.ccc561900
1.1.0-alpha.c667a8340
1.1.0-alpha.64dde1e20
1.1.0-alpha.47d16c130
1.1.0-alpha.63619ba10
1.1.0-alpha.5d5d840f0
1.1.0-alpha.3292553c0
1.1.0-alpha.eef645a00
1.1.0-alpha.412c97470
1.0.20
1.1.0-alpha.38e295790
1.1.0-alpha.fb5f3b790
1.1.0-alpha.68975eb40
1.1.0-alpha.6a288aed0
1.0.10
1.1.0-alpha.9053ee920
1.1.0-alpha.52cafd220
1.1.0-alpha.cbfce4cd0
1.1.0-alpha.cb49a83a0
1.1.0-alpha.ca72ed4a0
1.0.00
0.3.0-alpha.f94d6eeb0
0.3.0-alpha.c4ed1a5a0
0.3.0-alpha.853350200
0.3.0-alpha.0af71f650
0.3.0-alpha.884cbfbf0
0.2.20
0.3.0-alpha.64b91c220
0.3.0-alpha.ac36fe7c0
0.3.0-alpha.70ff7bd30
0.3.0-alpha.e9d1e49a0
0.3.0-alpha.b060fd510
0.3.0-alpha.9f9ad2900
0.2.10
0.3.0-alpha.7036f1a70
0.3.0-alpha.9678cb5d0
0.3.0-alpha.1ccb021e0
0.3.0-alpha.bb03e5a80
0.3.0-alpha.413ab9740
0.3.0-alpha.75fb72650
0.2.00
0.2.0-alpha.c0ecea5d0
0.2.0-alpha.9297da9f0
0.2.0-alpha.08f4e1e10
0.2.0-alpha.25fbfdbe0
0.2.0-alpha.ac6e07070

Package Sidebar

Install

npm i @crave/farmblocks-hoc-withtooltip

Weekly Downloads

16

Version

1.3.3

License

MIT

Unpacked Size

24 kB

Total Files

7

Last publish

Collaborators

  • viniciusmartin
  • luis.nascimento
  • seocam
  • vnakamura
  • alcferreira
  • imwra