Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
mgr-tooltip-react
Advanced tools
Readme
Simple react component for tooltips. A tooltip content can be any React component and is styled by yourself.
npm install mgr-tooltip-react --save
Since it is a React module, I suppose you have the webpack and bable configured.
import React from 'react';
import Tooltip from 'mgr-tooltip-react';
const ExampleComponent = () => {
const TooltipContent = (<div id="exampleTooltip" className="my-tooltip-style">
<p>Here is your tooltip content component</p>
</div>);
return (<div>
<Tooltip
tooltip={TooltipComponent}
placement="left"
tooltipId="exampleTooltip"
parentId="exampleParent">
<div id="exampleParent" className="my-parent-element-style">
<p>Here is the content which should be hovered to show the tooltip</p>
</div>
</Tooltip>
</div>);
}
Note the presence of id inside the tooltip body component as well as in the tooltip parent component - this is mandatory for the tooltip positionnment.
Tooltip
works as a wrapper for your component and shows the tooltip on mouse hover on its child element. Child element should be wrapper by a div
with a unique id
field, named parentId
.
The tooltip content is passed as a propery to the Tooltip
component. The tooltip wrapper component should also have an id
named tooltipId.
Tooltip
component takes following properties:
tooltip
: React element, required.
The component that will be rendered as a tooltip. The high order component of this property should have an id
name tooltipId.
Also, you can pass the onShow
and onHide
callbacks that would be called when the tooltip will be shown or hidden. Each of this callbacks will tak an rerender
frunction that, when called, will rerender the whole tooltip component.parentId
: String, required.
The id that will be used to query the tooltip parent DOM element.tooltipId
: String, required.
The id that will be used to query the tooltip content DOM element.placement
: String. Can be "top"
, "bottom"
, "left"
, "right"
.FAQs
Simple react component for tooltips.
The npm package mgr-tooltip-react receives a total of 1 weekly downloads. As such, mgr-tooltip-react popularity was classified as not popular.
We found that mgr-tooltip-react demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.