
Security News
Official Go SDK for MCP in Development, Stable Release Expected in August
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
react-tooltip-lite
Advanced tools
A lightweight and responsive tooltip. Feel free to Post an issue if you're looking to support more use cases.
$ npm install react-tooltip-lite
import Tooltip from 'react-tooltip-lite';
<Tooltip content="Go to google">
<a href="http://google.com"> edge</a>
</Tooltip>
CodePen demo: http://codepen.io/bsidelinger912/pen/WOdPNK
By default you need to style react-tooltip-lite with CSS, this allows for psuedo elements and some cool border tricks, as well as using sass variables and such to keep your colors consistant. But as of version 1.2.0 you can also pass the "useDefaultStyles" prop which will allow you to use react-tooltip-lite without a stylesheet. Here's an example stylesheet:
/* default tooltip styles */
.react-tooltip-lite {
background: #333;
color: white;
}
.react-tooltip-lite-up-arrow {
border-top: 10px solid #333;
}
.react-tooltip-lite-down-arrow {
border-bottom: 10px solid #333;
}
.react-tooltip-lite-right-arrow {
border-right: 10px solid #333;
}
.react-tooltip-lite-left-arrow {
border-left: 10px solid #333;
}
You can pass in props to define tip direction, styling, etc. Content is the only required prop.
Name | Type | Description |
---|---|---|
content | node (text or html) | the contents of your hover target |
tagName | string | html tag used for className |
direction | string | the tip direction, defaults to up. Possible values are "up", "down", "left", "right" with optional modifer for alignment of "start" and "end". e.g. "left-start" will attempt tooltip on left and align it with the start of the target. If alignment modifier is not specified the default behavior is to align "middle". |
className | string | css class added to the rendered wrapper |
background | string | background color for the tooltip contents and arrow |
color | string | text color for the tooltip contents |
padding | string | padding amount for the tooltip contents (defaults to '10px') |
styles | object | style overrides for the target wrapper |
eventOn | string | full name of supported react event to show the tooltip, e.g.: 'onClick' |
eventOff | string | full name of supported react event to hide the tooltip, e.g.: 'onClick' |
eventToggle | string | full name of supported react event to toggle the tooltip, e.g.: 'onClick', default hover toggling is disabled when using this option |
useHover | boolean | whether to use hover to show/hide the tip, defaults to true |
useDefaultStyles | boolean | uses default colors for the tooltip, so you don't need to write any CSS for it |
isOpen | boolean | forces open/close state from a prop, overrides hover or click state |
tipContentHover | boolean | defines whether you should be able to hover over the tip contents for links and copying content, defaults to false. |
hoverDelay | number | the number of milliseconds to determine hover intent, defaults to 200 |
arrow | boolean | Whether or not to have an arrow on the tooltip, defaults to true |
distance | number | The distance from the tooltip to the target, defaults to 10px with an arrow and 3px without an arrow |
<Tooltip
content={(
<div>
<h4 className="tip-heading">An unordered list to demo some html content</h4>
<ul className="tip-list">
<li>One</li>
<li>Two</li>
<li>Three</li>
<li>Four</li>
<li>Five</li>
</ul>
</div>
)}
direction="right"
tagName="span"
className="target"
>
Target content for big html tip
</Tooltip>
To see more usage examples, take look at the /example folder in the source.
FAQs
React tooltip, focused on simplicity and performance
The npm package react-tooltip-lite receives a total of 11,203 weekly downloads. As such, react-tooltip-lite popularity was classified as popular.
We found that react-tooltip-lite demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
Security News
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.