didww / react-tooltip

Simple Tooltip component

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Tooltip

Simple Tooltip component

Install

npm install @didww/react-tooltip or yarn add @didww/react-tooltip

Usage

import Tooltip  from '@didww/react-tooltip';

const MyComponent = () => {
  return (
    <Tooltip title={ <span>Tooltip Title here</span> }>
      <p>Tooltip Content here</p>
    </Tooltip>
  );
};

Api

Parameter Description Type Default
title Element, which triggers tooltip appearance ReactNode - (required)
children Content of tooltip ReactNode | ReactNode[] null
placement Position of displayed tooltip content top-left | top-right | bottom-left |bottom-right top-right
maxWidth Maximum width in pixels of tooltip content number 198
className className of tooltip wrapper component string ''

About

Simple Tooltip component


Languages

Language:JavaScript 94.0%Language:SCSS 5.7%Language:CSS 0.3%