By including this component, you can show tooltip on text overflow. Lets see how to use this library. This library built on top of react-bootstrap so you should install react-bootstrap to use this

Using npm

npm install text-overflow-tooltip --save

Import component

import TextOverflowTooltip from 'react-text-overflow-tooltip';


Here you can pass maximum width, style, className, tooltip (popover) placement 
   className="myCustomClass">give some overflow text here

Full Example

Here you can find full example. 
import React from 'react';
import TextOverflowTooltip from 'react-text-overflow-tooltip';
import '../../node_modules/bootstrap/dist/css/bootstrap.css'
import '../../node_modules/react-text-overflow-tooltip/lib/react-text-overflow-tooltip.css'

export default class App extends React.Component {

  constructor(props) {

  render() {
    return (
        <h1>It Works </h1>
        <p>Mouser hover on below text</p>
        <TextOverflowTooltip maxWidth="100px">give some overflow text here</TextOverflowTooltip>

1 comment:

  1. WOW! I am actually getting ready to across this information, is very helpful for me my friend. Xerox Printer Customer Service I really thankful to you.



Follow this blog by Email

Popular Posts