
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@deepdub/react-ok-tooltip
Advanced tools
React Ok Tooltip is a simple and easy to use tooltip component for React.
React Ok Tooltip is a simple and easy to use tooltip component for React.
Inside App.tsx:
import { OkTooltip } from '@deepdub/react-ok-tooltip';
import '@deepdub/react-ok-tooltip/dist/tooltip.css';
function App() {
return (
<>
{/* insert app here... */}
<OkTooltip arrowSize={5} />
</>
);
}
Then, inside Component.tsx:
import { tooltip } from '@deepdub/react-ok-tooltip';
function Component() {
return (
<button ref={tooltip('I am a tooltip!')}>Hover me!</button>
);
}
tooltip()
method accepts two parameters: title
(a string) and options
(an object of shape TooltipProps
).
TooltipProps
may include any of the follwing:
string
- A subtitle that will appear, well, below the title.string
- A string, passed to the tooltip's style.maxWidth
.string
- A string, passed to the tooltip's style.fontWeight
.All are optional.
Customize the tooltip by passing any of these to <Tooltip>
:
number
- The size of the arrow.string
- The background color of the tooltip.string
- The border color of the tooltip.number
- Tooltip delay in milliseconds (default: 1000).string
- Will be passed on the to tooltip itself.string
- Will be passed on the to tooltip itself.All are optional.
React Ok Tooltip also supports a concept we've called "tooltip group".
A tooltip group lets you anchor multiple tooltips to a single element (as shown in the GIF above, when the cursor hovers the middle section).
import { tooltip } from '@deepdub/react-ok-tooltip';
function Component() {
return (
<div ref={tooltipGroup()}>
<button ref={tooltip('Cut Selection')}>Cut</button>
<button ref={tooltip('Copy Selection')}>Copy</button>
<button ref={tooltip('Paste')}>Paste</button>
</div>
);
}
FAQs
React Ok Tooltip is a simple and easy to use tooltip component for React.
We found that @deepdub/react-ok-tooltip demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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 Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
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.