2.1.0 • Published 4 years ago

react-smart-tooltip v2.1.0

Weekly downloads
384
License
MIT
Repository
github
Last release
4 years ago

React Smart Tooltip

React Smart Tooltip usage react-tippy.

npm install react-smart-tooltip

Demo

Usage

import SmartTooltip from 'react-smart-tooltip'; // by default import SmartTooltip
//or
import SmartTooltip, { Tooltip, hocWithTooltip } from 'react-smart-tooltip'; // Tooltip - react-tippy, hocWithTooltip - react-tippy HOC. See docs of react-tippy

render() {
    <div> // wrapper with width in px or %
	    <SmartTooltip text="Text" /> // Text that should apply ellipsis styles and while hovering, display a hint with the full text
	    <Tooltip {...props}/>
	    //or
	    <Tooltip {...props}>
	        <div>Hover me</div>
	    </Tooltip>
	</div>
}

Props Tooltip

See react-tippy props.

Props SmartTooltip

SettingDefaultOptionsRole
tooltipdisabled: falseSee react-tippy props.
textundefinedstringText that should apply ellipsis styles and while hovering, display a hint with the full text
stylewhiteSpace: 'nowrap'; textOverflow: 'ellipsis'; overflow: 'hidden'objectStyles for overwriting the standard styles
className---stringClassname for content, you can use with style prop
onMouseEnter---functionOn mouse enter handler
onShowTooltip---functionCallback after on mouse enter then tooltip show

Contributing

If you want to contribute to the development of a component - leave the issues or PR.

Thank you

2.1.0

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago