0.1.12 • Published 6 years ago

react-autotip v0.1.12

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

react-autotip

Build Status Coverage Status npm

A handful of simple, auto-positioning tooltips (compatible only with React 16+)

npm i react-autotip

TooltipPortalProvider

import { TooltipPortalProvider } from 'react-autotip'

ReactDOM.render(
  <TooltipPortalProvider>
    <App />
  </TooltipPortalProvider>,
  document.getElementById('app')
)

Props

namedefaultdescription
style{}Pass styling to the portal DOM element

Tooltip

import Tooltip from 'react-autotip'

const MyComponent = () => (
  <Tooltip type="info" text="I am tooltip.">
    <div>
      Hover over me to to reveal tooltip.
    </div>
  </Tooltip>
)

Automatic Positioning

Wrap any element with a Tooltip and it will automatically position itself to either the top, right, bottom, or left based on where in the viewport its child element is rendered.

Type (prop)

namedefaultdescription
infoA standard tooltip with a small caret
dialogA caret-less tooltip with a white background

Other props

namedefaultdescription
text""The text to render inside the tooltip
style{}Pass any positioning style, etc here
tooltipStyles{}Change aspects of the tooltip's style
delay0msDelay before tooltip appears (in milliseconds)
toggleOnClickfalseTooltip appears only after clicking on target element
motionConfig{stiffness: 210: damping: 20}Choose your own params here
padding16pxMinimum padding between edge of viewport and tooltip
offset8pxOffset between the tooltip and the tooltip's child
caretSize5pxSize of the tooltip's caret
0.1.12

6 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago