tooltip-react-component
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Tooltip React Component;

Introduction:

The Tooltip React Component a versatile and customizable tooltip solution for React applications. It provides a simple way to add informative tooltips to elements, enhancing user experience and providing helpful hints or additional context. alt text

1 Install :

npm i tooltip-react-component

2Use in react :

import React from 'react';
import { Tooltip } from "tooltip-react-component"


const MyComponent = () => {
  return (
    <Tooltip content="This is a tooltip">
      <button>Hover me</button>
    </Tooltip>
  );
};

export default MyComponent;

Feature:

Customizable Positioning: Place tooltips on the top, bottom, left, or right of the target element.

Custom Styling: Easily adjust the background color, text color, and other styling properties to match your application's design.

Dynamic Content: Display dynamic content within tooltips, such as text or JSX elements.

Responsive Design: Ensures tooltips adapt to different screen sizes and orientations for optimal usability.

Event Handling: Supports hover events for showing and hiding tooltips, ensuring a smooth and intuitive user interaction.

Props:

The Tooltip component accepts the following props:

  • content (string): The content to be displayed within the tooltip.
  • position (optional | string): The position of the tooltip relative to the target element ('top', 'bottom', 'left', 'right'). Defaults to 'top'.
  • backgroundColor (optional | string): The background color of the tooltip. Defaults to 'rgba(0, 0, 0, 0.8)'.
  • color (optional | string): The text color of the tooltip. Defaults to '#fff'.

Author :

Copyright 2024 mia nguyen x thind9xdev

Licensed under the MIT License

/tooltip-react-component/

    Package Sidebar

    Install

    npm i tooltip-react-component

    Weekly Downloads

    5

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    7.01 kB

    Total Files

    6

    Last publish

    Collaborators

    • thind9xdev