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

bpk-component-tooltip

Package Overview
Dependencies
Maintainers
6
Versions
464
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bpk-component-tooltip

Backpack tooltip component.

  • 9.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-98.51%
Maintainers
6
Weekly downloads
 
Created
Source

bpk-component-tooltip

Backpack tooltip component.

Installation

npm install bpk-component-tooltip --save-dev

Usage

import React, { Component } from 'react';
import BpkText from 'bpk-component-text';
import BpkTooltip from 'bpk-component-tooltip';

const App = () => (
  const targetRef = useRef(null);
  const target = (
    <div ref={targetRef} className={'my-tooltip-target'}>
      <BpkText textStyle="lg">LHR</BpkText>
    </div>
  );

  <BpkTooltip
    ariaLabel="London Heathrow"
    id="my-tooltip"
    target={target}
  >
    London Heathrow
  </BpkTooltip>
);

Props

PropertyPropTypeRequiredDefault Value
ariaLabelstringtrue-
idstringtrue-
childrennodetrue-
targetnodetrue-
hideOnTouchDevicesboolfalsetrue
placementoneOf(['top', 'right', 'bottom', 'left'])false'bottom'
paddedboolfalsetrue
portalStyleobjectfalsenull
portalClassNamestringfalsenull
popperModifiersarrayOf(object)falsenull
renderTargetfuncfalsenull
typeoneOf(TOOLTIP_TYPES.light, TOOLTIP_TYPES.dark)falseTOOLTIP_TYPES.light

Prop Details

ariaLabel

Tooltips are invisible to assistive technologies such as screen readers. To improve accessibility, ariaLabel is required to describe the content of the tooltip to assistive technologies.

The label will be used on the target element, so any existing aria-label attached to target will be overridden.

popperModifiers

Please refer to the documentation for the underlying positioning library "Popper.js". You can achieve various behaviours such as allowing the tooltip to overflow the viewport etc.

target

target should be a DOM element with a ref attached to it.

FAQs

Package last updated on 09 Sep 2022

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