react-toolbox/components/tooltip
Raúl García 6eb58380c4 Add missing semicolons 2016-01-11 09:02:50 +01:00
..
Tooltip.jsx Add missing semicolons 2016-01-11 09:02:50 +01:00
_config.scss New approach for Tooltips 2015-11-29 12:39:55 +01:00
index.js Remove jsx extension from imports in components 2015-11-28 20:24:46 +01:00
readme.md Allow Link to render Tooltips via children prop 2016-01-05 23:32:38 +01:00
style.scss Fixes #214 2015-12-19 21:06:18 +01:00

readme.md

Tooltip

A Tooltip is useful to show information on hover in any kind of component. We have a component that can be used as a decorator for any kind of component. You just have to take into account that the overflow in the component should be visible.

import Button from 'react-toolbox/lib/button';
import Tooltip from 'react-toolbox/lib/tooltip';
import Link from 'react-toolbox/lib/link';

const TooltipButton = Tooltip(Button);
const TooltipInput = Tooltip(Input);
const TooltipLink = Tooltip(Link);

const TooltipTest = () => (
  <div>
    <TooltipButton label='Bookmark' icon='bookmark' raised primary tooltip='Bookmark Tooltip' tooltipDelay={1000} />
    <TooltipButton icon='add' floating accent tooltip='Floating Tooltip' />
    <TooltipLink count={42} href="#" label="The answer is" icon='speaker_notes' tooltip='Question - universe?'/>
    <TooltipInput tooltip='lorem ipsum...' />
  </div>
);

Properties

In any component you decorate with the Tooltip you'd get some additional props:

Name Type Default Description
tooltip String The text string to use for the tooltip.
tooltipDelay Number Amount of time in miliseconds spent before the tooltip is visible.
tooltipHideOnClick Boolean true If true, the Tooltip hides after a click in the host component.