Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to open tool tip on click event? #20

Open
youngsingh opened this issue May 10, 2019 · 1 comment
Open

Is it possible to open tool tip on click event? #20

youngsingh opened this issue May 10, 2019 · 1 comment

Comments

@youngsingh
Copy link

how can we open tooltip on click event ?

@cedricdelpoux
Copy link
Owner

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>
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants