Socket
Socket
Sign inDemoInstall

react-single-tooltip

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-single-tooltip

A tiny tooltip component.


Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

react-single-tooltip is a opinionated tooltip component. It uses no dependencies. so, it is tiny yet intelligent.

Usage

To start using the library, install it in your project:

npm install react-single-tooltip

Add <SingleTooltip /> to your app, it will be the place where all your tooltip will be rendered. After that you can use useTooltip() hook in your component.

import { useTooltipRef, SingleTooltip } from 'react-single-tooltip';

function App() {
  const ref = useTooltipRef("Tooltip content")
  
  return (
    <div>
      <SingleTooltip />
      <button ref={ref}>Hover me</button>
    </div>
  );
}

Props

SingleTooltip component

NameTypeDefaultDescription
backgroundColorstringrgba(0, 0, 0, 0.8)-
zIndexnumber99-
borderRadiusnumber12-
offsetnumber | string4container padding
paddingnumber | string12content padding
fontSizenumber | string14-
colorstringwhite-
maxWidthnumber | string360px(200px in mobile)-
trangleWidthnumber16the bottom triangle
trangleHeightnumber6the bottom triangle

useTooltip params

NameTypeDefaultDescription
textstringundefinedrequired
showbooleantrue-

Keywords

FAQs

Package last updated on 11 Sep 2023

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