Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-tooltip

Package Overview
Dependencies
Maintainers
1
Versions
347
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-tooltip - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

gulpfile.js

6

example/index.js
'use strict';
var React = require("react");
var ReactTooltip = require("../");
var ReactTooltip = require("../index");

@@ -11,4 +11,4 @@ var Index = React.createClass({

<p data-placeholder="foo">hover on me</p>
<p data-placeholder="This is another hover test" data-place="bottom">hover on me</p>
<ReactTooltip place="top"/>
<p data-placeholder="This is another hover test" data-place="bottom">Tooltip from bottom</p>
<ReactTooltip />
</section>

@@ -15,0 +15,0 @@ )

@@ -5,3 +5,10 @@ 'use strict';

var classNames = require("classnames");
var basicClass = require("./src/basic");
var basicShowClass = require("./src/basic-show");
var topPlaceClass = require("./src/place-top");
var bottomPlaceClass = require("./src/place-bottom");
var RCSS = require("rcss");
RCSS.injectAll();
var ReactTooltip = React.createClass({

@@ -69,8 +76,15 @@ getInitialState: function() {

}
var toolTipClass = classNames({
"react-tooltip": true,
"show": this.state.show,
"place-top": this.state.place === "top",
"place-bottom": this.state.place === "bottom"
})
var classNamesObject = {};
classNamesObject[basicClass.className] = true ;
if(this.state.show) {
classNamesObject[basicShowClass.className] = true ;
}
if(this.state.place === "top") {
classNamesObject[topPlaceClass.className] = true
}
if(this.state.place === "bottom") {
classNamesObject[bottomPlaceClass.className] = true;
}
var toolTipClass = classNames(classNamesObject)
return (

@@ -77,0 +91,0 @@ <span className={toolTipClass} style={style} data-id="tooltip">{this.state.placeholder}</span>

{
"name": "react-tooltip",
"version": "0.0.1",
"version": "0.1.0",
"description": "react tooltip component",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"build": "webpack",
"dev": "webpack-dev-server --devtool eval --progress --colors --hot --cotent-base build"
},

@@ -30,2 +31,3 @@ "repository": {

"classnames": "^1.2.0",
"rcss": "^0.1.5",
"react": "^0.13.1"

@@ -35,2 +37,3 @@ },

"browserify": "^9.0.7",
"css-loader": "^0.10.1",
"gulp": "^3.8.11",

@@ -41,3 +44,5 @@ "gulp-rename": "^1.2.2",

"gulp-util": "^3.0.4",
"jsx-loader": "^0.13.1",
"reactify": "^1.1.0",
"style-loader": "^0.10.1",
"vinyl-buffer": "^1.0.0",

@@ -44,0 +49,0 @@ "vinyl-source-stream": "^1.1.0",

# react-tooltip
react tooltip component
React tooltip component, inspired by tooltipsy (a jquery plugin I've used)
[![Version](http://img.shields.io/npm/v/react-tooltip.svg)](https://www.npmjs.org/package/react-tooltip)
### Installation
```
npm install react-tooltip --save
```
### Usage
1 . Require react-tooltip after installation
```
var ReactTooltip = require("react-tooltip")
```
2 . Add data-placeholder = "your placeholder" to your element
<p data-placeholder="hello world">Tooltip</p>
3 . Including react-tooltip component
```
<ReactTooltip />
```
### Example
```
'use strict';
var React = require("react");
var ReactTooltip = require("../index");
var Index = React.createClass({
render: function() {
return (
<section className="tooltip-example">
<p data-placeholder="foo">hover on me</p>
<p data-placeholder="This is another hover test" data-place="bottom">Tooltip from bottom</p>
<ReactTooltip />
</section>
)
}
});
React.render(<Index />,document.body)
```
### License
MIT

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc