1.3.20 • Published 3 years ago

rc-simple-tooltip v1.3.20

Weekly downloads
138
License
MIT
Repository
github
Last release
3 years ago

Simple react tooltip component

License npm Build Status

Demo

Demo

Installation

Install package with npm:

npm i rc-simple-tooltip

Install package with yarn:

yarn add rc-simple-tooltip

Basic Usage

Import Tooltip component:

import Tooltip from 'rc-simple-tooltip';

Wrap your component with Tooltip:

<Tooltip trigger="hover" content="Tooltip content">
  <button>Complete action</button>
</Tooltip>

Tooltip works with any component that supports refs. For custom functional components you need to forward ref:

const Button = React.forwardRef(({children, ...props}, ref) =>
  <button {...props} ref={ref}>{children}</button>
);
<Tooltip trigger="hover" content="Tooltip content">
  <Button>Complete action</Button>
</Tooltip>

Tooltip can be used without any children:

<Tooltip top content="Tooltip content" />

Additionally import styles.css to apply default styling:

import 'rc-simple-tooltip/dist/styles.css';

Props

NameTypeDefaultDescription
activeBooleantrueShow tooltip
timeoutInt0Time delay before hiding tooltip in hover mode
contentNodenullTooltip content
position'left'\|'right'\|'top'\|'bottom'nullTooltip position
trigger'click'\|'focus'\|'hover'nullTooltip activation trigger
classNameStringnullclassName value
stylesObjectnullstyles value

Running locally

With yarn:

yarn start

With npm:

npm start
1.3.20

3 years ago

1.3.18

3 years ago

1.3.19

3 years ago

1.3.17

3 years ago

1.3.16

3 years ago

1.3.15

3 years ago

1.3.14

3 years ago

1.3.13

3 years ago

1.3.12

4 years ago

1.3.11

4 years ago

1.3.10

4 years ago

1.3.9

4 years ago

1.3.8

4 years ago

1.3.7

4 years ago

1.3.6

4 years ago

1.3.5

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago