react-simple-tooltip icon indicating copy to clipboard operation
react-simple-tooltip copied to clipboard

Is it possible to open tool tip on click event?

Open youngsingh opened this issue 6 years ago • 1 comments

how can we open tooltip on click event ?

youngsingh avatar May 10 '19 10:05 youngsingh

For now you can use the standalone version

import React from "react"
import Tooltip from "react-simple-tooltip"

const App = () => (
  <div style={{position: "relative"}}>
    <Tooltip
      style={{position: "absolute", top: "50%", right: "0"}}
      content="😎"
    />
  </div>
)

and trigger onClick to your component.

If you want to make a PR to use a syntax similar to this, I'm open :)

import React from "react"
import Tooltip from "react-simple-tooltip"

const App = () => (
  <Tooltip content="😎" openOnClick>
    <button>Hover me !</button>
  </Tooltip>
)

cedricdelpoux avatar May 23 '19 11:05 cedricdelpoux