0.2.1 • Published 3 years ago
solid-tippy v0.2.1
solid-tippy
SolidJS bindings for Tippy.js
Install
npm i tippy.js solid-tippyyarn add tippy.js solid-tippypnpm add tippy.js solid-tippyUsage
import { tippy, useTippy } from 'solid-tippy';
// As directive
<button
use:tippy={{
props: {
content: 'This is a tooltip.',
},
}}
>
Example
</button>
// as hook
const [anchor, setAnchor] = createSignal();
useTippy(anchor, {
props: {
content: 'This is a tooltip.',
},
});
<button ref={anchor}>
Example
</button>Options
disabled: Disables the Tippy instance. Defaults tofalse.hidden: Hides the Tippy instance. Defaults tofalse.props: Props to be passed to the Tippy instance when creating or updating it. You can read more about it here.
Headless mode
You may use tippyHeadless or useTippyHeadless instead of tippy and useTippy for Headless Tippy instances.
License
MIT © lxsmnsyc