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

react-simple-tooltip

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-simple-tooltip

A lightweight and simple tooltip component for React

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.6K
decreased by-23.09%
Maintainers
1
Weekly downloads
 
Created
Source

react-simple-tooltip

A lightweight and simple tooltip component for React

Install

npm install --save react-simple-tooltip

react-simple-tooltip

Changelog

See changelog

Usage

Examples

Tooltip example

Fixed Tooltip
import React from 'react'
import { Tooltip } from 'react-simple-tooltip'

export default class MyComponent {
  render() {
    return (
      <div>
        <Tooltip>
          <div>react-simple-tooltip</div>
          <div>By cedricdelpoux</div> 
        </Tooltip>
      </div>
    )
  }
}
Hover Tooltip
import React, { Component } from 'react'
import { Tooltip } from 'react-simple-tooltip'

export default class MyComponent extends Component {
  constructor(props, context) {
    super(props, context)

    this.state = {
      tooltipTrigger: null,
    }
  }

  handleHover(trigger) {
    this.setState({
      tooltipTrigger: trigger,
    })
  }

  render() {
    return (
      <div>
        { this.state.tooltipTrigger
          ? (
            <Tooltip placement="top" trigger={ this.state.tooltipTrigger }>
              <div>react-simple-tooltip</div>
              <div>By cedricdelpoux</div> 
            </Tooltip>
          )
          : null
        }


        <RandomComponent
          onComponentHover={ ::this.handleHover }
        />
      </div>
    )
  }
}

Props

  • placement: String - by default is right - one of ['top', 'right', 'bottom', 'left']
  • theme: String - by default is black - one of ['black', 'grey', 'blue', 'green', 'yellow', 'red']
  • trigger: React element - by default is null

Development

Clean lib folder

npm run clean

Build lib folder

npm run build

Watch src folder

npm run watch

Lint src folder

npm run build

License

See MIT

Keywords

FAQs

Package last updated on 03 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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