
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Install with npm:
npm install --save hot-tip
Install with yarn:
yarn add hot-tip
The examples contains all the information here and more.
yarn run examples
We weren't happy with tooltip solutions that looked like react components but under the cover used the DOM api directly (or heaven forbid jQuery). HotTip
Using React & Redux? HotTip's only dependencies are react, redux and react-redux
HotTip plugs directly into your application state, you'll never need to force a redraw
HotTip does only one thing, it positions and displays tooltips
Positioning is responsive, if you're close to frame boundaries HotTip responds in a predictable way (see examples)
HotTip bundles in at about 40kb (10kb compressed)
HotTip has four basic positions Top, Left, Right, and Bottom. Extra Long tips
There is a maximum width of 200px for a tooltip.
Overflow and wrapping is handled differently for each position Top, Left, Right, and Bottom.
Position auto-adjustments
Hot Tip will do some magic to make sure your tooltips are always visible even if the target is close to a page boundary. All positioning utils are available as a named import.
import {utils} from 'hot-tip'
HotTip exposes four modules: two components, a reducer and some utils. The two components are HotTipRoot and HotTip.
The reducer should be included in your redux combineReducers array, it is exported as hotTipReducer. The HotTipRoot is connected to a data-store of this exact name so it's advised to use destructuring.
import {HotTip, HotTipRoot, hotTipReducer, utils} from 'hot-tip'
The utils just provide access to the same positioning calculations that HotTip uses in case they are useful elsewhere in an application (why not?).
As the HotTip
component is the part you'll be reaching for most regularly it is also the default export which means you can import it easily using whatever name you want:
import HotTip from 'hot-tip'
<HotTip tip="I'm a tooltip">hover here</HotTip>
// or
import Hover from 'hot-tip'
<Hover tip="I'm a tooltip">hover here</Hover>
HotTip is on MIT so can be used anywhere with almost no restrictions.
To contribute please read the CONTRIBUTING file.
[1.0.5] - 2018-01-19
FAQs
A stress-free redux/react tooltip solution
We found that hot-tip demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.