This is just a tini-tiny Tooltip library, with a simple way to use it, it doesn't currently have a lot of features, but it is certainly a pleasure package to work with.
npm install --save little-react-tooltip
import React from 'react';
import Tooltip from 'little-react-tooltip';
const Example: React.FC = () => {
return (
<Tooltip
tooltipText="Hey, this is a tooltip!"
>
<p>Hover me!</p>
</Tooltip>
)
}
NOTE: the children object of the tooltip NEEDS to be a React Element or a HTML Element, you can't just pass a normal text.
If a prop is Required, the default
field will appear empty.
name | type | default |
---|---|---|
tooltipText | string | -- |
size | string | medium |
position | string | top |
colors | object: font, background | font: black, background: white |
children | ReactElement or HTMLElement | -- |
MIT © Bruno De Masi