Simple tooltip component
$ npm install vdux-tooltip
Renders your message
as a tooltip over children
when the user lingers over children
.
import Tooltip from 'vdux-tooltip'
function render () {
return (
<Tooltip message='Signup today!' delay={400}>
<button>Register</button>
</Tooltip>
)
}
ui
- Optional, defaults to vdux-ui's Tooltip component. This is the UI element used to render your tooltip componentmessage
- The content of the tooltip. This may be just a string or it may be JSX elements.placement
- Defaults toleft
. One oftop/right/bottom/left
. Specifies where the tooltip should appear relative to the container.space
- Optional. Defaults to 0. Add extra padding away from the element when the tooltip is positioned....rest
- Any other props will be forwarded to the tooltip UI component.
The children of the tooltip are what the tooltip is for. They are rendered normally as if the tooltip wasn't there.
MIT