1.0.33 • Published 2 years ago

react-modern-tooltip v1.0.33

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

React Modern Tooltip

React Modern Tooltip is a informative message or custom objects that appears when user interacts with item. This package designed for using with ReactJS and Next.Js project.

NPM JavaScript Style Guide

Detailed documentation is coming soon.

Installation

With NPM

npm install --save react-modern-tooltip

Usage

1- Require react-modern-tooltip after installation

import Tooltip from 'react-modern-tooltip'
import 'react-modern-tooltip/dist/tooltip.css'

2- Example Usage

<Tooltip
  placement='topStart'
  color='blue'
  content='Developers love React Modern Tooltip'
>
  Tooltip
</Tooltip>

Options

PropTypeDefaultDescription
contentstring/objectnullContent of the Tooltip to display Required
colorstringredTooltip background color Required
placementstringtopTooltip placement relative to the target Required
shadowbooleanfalseDisplay shadow effect
focusbooleanfalseKeeps open when tooltip target hovered
roundedbooleantrueBorder radius Tooltip
blockbooleanfalseMakes tooltip target full width relative to parent
offset(px)number10Tooltip space relative to target
arrowOffset(px)number15Space to near edge of Tooltip arrows.
triggerstringhoverTooltip trigger mode
classNamestringnullAdd target classname
popupClassNamestringnullAdd tooltip classname

PropTypes

Color

oneOf([
  'red',
  'yellow',
  'orange',
  'green',
  'purple',
  'blue',
  'turqoise',
  'cyan',
  'gray',
  'white'
])

Placement

oneOf([
  'top',
  'topStart',
  'topEnd',
  'left',
  'leftStart',
  'leftEnd',
  'bottom',
  'bottomStart',
  'bottomEnd',
  'right',
  'rightStart',
  'rightEnd'
])

Trigger

oneOf(['click', 'hover'])

License

MIT © necatayhan