mariomc / react-overflow-tooltip

A React component that adds a tooltip only if the text is overflow.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-overflow-tooltip

npm travis

A React component that shows a tooltip only if the text is overflow.

var ReactOverflowTooltip = require('react-overflow-tooltip')

<ReactOverflowTooltip title='too long text'>
  <div>too long text</div>
</ReactOverflowTooltip>
// => <div title="too long text...">too long text...</div>

<ReactOverflowTooltip title='short text'>
  <div>{ text }</div>
</ReactOverflowTooltip>
// => <div>too long text...</div>

Install

npm install react-overflow-tooltip

License

ISC

About

A React component that adds a tooltip only if the text is overflow.

License:ISC License


Languages

Language:JavaScript 100.0%