Code Monkey home page Code Monkey logo

react-tooltip's Introduction

React Tooltip renovate-app badge CircleCI

A tooltip component for React apps utilizing the excellent popper.js library.

Installation

npm install --save @cypress/react-tooltip

Usage

import Tooltip from '@cypress/react-tooltip'

<Tooltip title="Hello World">
  <button>Click me</button>
</Tooltip>

The tooltip will automatically appear when mousing over the button and disappear when mousing out from the button.

Options

option default description supported values
title undefined Required. The tooltip content Anything renderable by React (string, number, element, etc)
placement 'top' The placement of the tooltip Placements supported by popper.js
visible undefined Whether to show the tooltip when rendered. This overrides the default showing/hiding on mouse-over/mouse-out true or false
className 'tooltip' Class applied to the tooltip
wrapperClassName '' Class applied to the <span> that wraps the children of <Tooltip>
updateCue undefined A prop that indicates that the tooltip's position should update. If the size of the tooltip target changes while the tooltip is showing, the tooltip won't know to update its position. Set this to something that's tied to the target's size or just to a new value to trigger an update of the tooltip's position.

Development

# watches JS and SCSS for changes and compiles
# runs tests for associated
npm run watch

# run all tests
npm test

# creates a demo page at http:localhost:8888/design.html for design purposes
npm run design

Changelog

For latest changelog see cypress-io/react-tooltip/releases. Older changes are below:

0.2.2 - (03/10/17)

  • Add customizable tooltip border

0.2.1 - (03/10/17)

  • Fix issues with class names

0.2.0 - (03/10/17)

  • Allow specifying tooltip class name and wrapper class name

0.1.4 - (03/10/17)

  • Upgrade popper.js to 1.x.x

0.1.1 - (09/29/16)

  • Guard against updating popper state when unmounted

0.1.0 - (09/28/16)

  • Initial release

react-tooltip's People

Contributors

bahmutov avatar brian-mann avatar chrisbreiding avatar flotwig avatar jennifer-shehane avatar randallkent avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.