Socket
Socket
Sign inDemoInstall

@radix-ui/react-tooltip

Package Overview
Dependencies
34
Maintainers
6
Versions
227
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @radix-ui/react-tooltip


Version published
Weekly downloads
1.4M
increased by3.06%
Maintainers
6
Install size
1.27 MB
Created
Weekly downloads
 

Package description

What is @radix-ui/react-tooltip?

The @radix-ui/react-tooltip package provides a lightweight, accessible, and customizable tooltip component for React applications. It allows developers to easily add tooltips to their UI elements, offering additional information or guidance to users in a non-intrusive way. The package focuses on accessibility and ease of use, ensuring that tooltips are usable by everyone, including those navigating via keyboard or using assistive technologies.

What are @radix-ui/react-tooltip's main functionalities?

Basic Tooltip Usage

This code demonstrates the basic usage of the @radix-ui/react-tooltip package. It shows how to create a simple tooltip that appears when the user hovers over or focuses on the trigger element.

{"import { Tooltip, TooltipTrigger, TooltipContent } from '@radix-ui/react-tooltip';\n\nfunction App() {\n  return (\n    <Tooltip>\n      <TooltipTrigger>Hover or focus me</TooltipTrigger>\n      <TooltipContent>Tooltip content</TooltipContent>\n    </Tooltip>\n  );\n}"}

Customizing Tooltip Appearance

This example shows how to customize the appearance of the tooltip and its position relative to the trigger element. It demonstrates the use of custom CSS classes and the 'side' and 'align' props to control the tooltip's placement.

{"import { Tooltip, TooltipTrigger, TooltipContent } from '@radix-ui/react-tooltip';\n\nfunction App() {\n  return (\n    <Tooltip>\n      <TooltipTrigger className='custom-trigger'>Hover me</TooltipTrigger>\n      <TooltipContent className='custom-content' side='top' align='center'>Custom styled tooltip</TooltipContent>\n    </Tooltip>\n  );\n}"}

Other packages similar to @radix-ui/react-tooltip

Readme

Source

react-tooltip

Installation

$ yarn add @radix-ui/react-tooltip
# or
$ npm install @radix-ui/react-tooltip

Usage

View docs here.

FAQs

Last updated on 25 Sep 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc