Coder Social home page Coder Social logo

rctx-tooltip's Introduction

rctx-tooltip

Tooltip package extensively for react library

Installation

npm install --save rctx-tooltip

Usage

import React, { Component } from 'react';
import RCTXTooltip from 'rctx-tooltip';

class Example extends Component {
  render () {
    return (
      <RCTXTooltip>
        <button>Hover over me</button>
      </RCTXTooltip>
    )
  }
}

Key features

  • Accept string or html.
  • Inbuild animation like zoom or fade.
  • Position the tooltip like however you want. You can specify offset as well.
  • Add class to the tooltip or tooltip container element and style it however you want.
  • Bunch of events like onShown or onHidden.
  • Control scroll or resize hide.
  • Append the tooltip anywhere you want.

Options

Checkout the example demo

Name Type Options Description
content String or Html default String It takes String or Html as input
isVisible Boolean true / false
Default: false
Show hide tooltip based on value
position String "top left" / "top right" / "bottom left" / "bottom right" / "top center" / "right center" / "bottom center" / "left center" (+ is also applicable after top/right bottom/left like "top+10 left")
Default: "top left"
Set tooltip position
animation String "fade" / "zoom"
Default: "fade"
Set animations for tooltip
event String "hover" / "click" / "focus"
Default: "hover"
Show tooltip on hover
delayHide Number Any number Hides tooltip in delay time mentioned
delayShow Number Any number Show tooltip in delay time mentioned
tooltipClass String Any string Add class in the tooltip popup
tooltipContainerClass String Any string Add class in the tooltip container popup
eventOff String "dblclick" On double click only close the tooltip
scrollToHide Boolean true / false
Default: true
On window scroll hides the tooltip
resizeToHide Boolean true / false
Default: true
On window resize hides the tooltip
appendTo String "body" / ".your_class_wrap" / "#your_id_wrap"
Default: Enclosed element
Append tooltip inside the input element
onHidden Function onHidden={() => console.log("I am hidden!!")} Invokes after tooltip gets hidden
onShown Function onShown={() => console.log("I am visible!!")} Invokes after tooltip gets visible

Contributing ๐Ÿ™

We will welcome any kind of contribution, small to big, suggestion to bug fixing or even collaborating. You can fork the repo and then make some changes and make a pull request. We will review your code and merge it ๐Ÿ‘.

License

MIT ยฉ reachtokish

rctx-tooltip's People

Contributors

node-kishore avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.