0.1.8 • Published 5 years ago

@devbihari/simple-react-tooltip v0.1.8

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

simple-react-tooltip

A simple light weight react package to display components as tooltip over other components

Installation

npm i @devbihari/simple-react-tooltip --save

or

yarn add @devbihari/simple-react-tooltip

How to use it

Just wrap your component and pass the tooltip you wish to use

<SimpleReactTooltip tooltip={TooltipComp}>
    <Child />
</SimpleReactTooltip>

Example

import React from 'react';
import './App.css';
import SimpleReactTooltip from '@devbihari/simple-react-tooltip';

const Child = () => {
  return(
    <div className={'child'}>
      <p>Hover over me</p>
    </div>
  )
}

function App() {

  const TooltipComp =  <div className={'tooltip'}>
    <p>I am a tooltip</p>
  </div>

  return (
    <div className="App">
      <SimpleReactTooltip tooltip={TooltipComp}>
        <Child />
      </SimpleReactTooltip>
      
    </div>
  );
}

export default App;

Result

sample gif


Road map

  • Hover to display tooltip
  • Custom design for tooltip
  • Delay while showing tooltip
  • Optimized for stateful components
0.1.8

5 years ago

0.1.7

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago