A simple UI library for light-weight, highly customizable React Tooltip.
Very Easy to use and integrate.
Installation
To start with react-tooltip-lib install:
yarn add react-tooltip-lib
// or
npm install --save react-tooltip-lib
Usage
importTooltipfrom"react-tooltip-lib";
Example 1.
exportdefaultclassAppextendsComponent{render(){return(<div><Tooltipplacement="bottom"initialVisibility="show"tipContent="This is React Tooltip library"/></div>);}}
Example 2.
// Your designed Component you can export from anywhereconstDesignedContentComponent=function(){return<div>Hello ToolTip</div>;};exportdefaultclassAppextendsComponent{render(){return(<div><Tooltipplacement="bottom"initialVisibility="show"tipContent={DesignedContentComponent}/></div>);}}
Example 3.
// Your Custom Icon. onClick or onHover you want to open Tooltip Content.By default icon is hint iconsimport{ReactComponentasInformationIcon}from"../../icons/information.svg";// Your designed Component you can export from anywhereconstDesignedContentComponent=function(){return<div>Hello ToolTip</div>;};exportdefaultclassAppextendsComponent{render(){return(<div><Tooltipplacement="bottom"initialVisibility="show"tipContent={DesignedContentComponent}><InformationIcon/></Tooltip></div>);}}
Properties
initialVisibility - ToolTip Content By Default Hide..
tipContent - Tiptool Content Pass as String or Pass and Designed Component
propName
propType
defaultValue
isRequired
initialVisibility
String
hide
-
tipContent
String or Pass Functional Component
-
yes
Themes
Example 4.
exportdefaultclassAppextendsComponent{render(){return(<div><TooltipinitialVisibility="show"tipTitle="This is React Tooltip library"theme="default"/></div>);}}
Properties
theme - By Default value is default .This value is string.
exportdefaultclassAppextendsComponent{render(){return(<div><TooltipinitialVisibility="show"tipTitle="This is React Tooltip library"trigger="onHover"/></div>);}}
Example 6.
exportdefaultclassAppextendsComponent{render(){return(<div><TooltipinitialVisibility="show"tipTitle="This is React Tooltip library"trigger="onHover"/></div>);}}
Properties
trigger - By Default value is onHover .This value is string.
propName
propType
defaultValue
otherValues
onHover
String
onHover
onHover,onHover
Placement
Example 7.
exportdefaultclassAppextendsComponent{render(){return(<div><Tooltipplacement="top"tipTitle="This is React Tooltip library"/></div>);}}
Properties
placement - By Default value is auto .This value is string.
propName
propType
defaultValue
otherValues
placement
String
auto
auto,left,right,top,bottom
ToopTip Content Layout Desiging Props
Example 8.
exportdefaultclassAppextendsComponent{render(){return(<div><TooltiptipContentWidth="50px"tipTitle="This is React Tooltip library"/></div>);}}