0.0.4 • Published 3 years ago

@sato0130/svelte-tooltip v0.0.4

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

@sato0130/svelte-tooltip

npm bundle size npm

Light weight svelte-action based tooltip.

Demo

https://svelte-tooltip-k-sato1995.vercel.app/

Installation

$ npm i @sato0130/svelte-tooltip

or

$ yarn add @sato0130/svelte-tooltip

Usage

  1. Import SvelteTooltip.
import SvelteTooltip from '@sato0130/svelte-tooltip';
  1. Use SvelteTooltip in the element you want the tooltip to be on

You can see the other options below.

<div use:SvelteTooltip={{ body: 'Tooltip content' }}>Hover Me</div>

Options

NameisRequiredtypeDescription
bodytruestring, SvelteComponentContent in the tooltip
bodyAsHTMLfalsefalse, trueRender the content as HTML
placefalsetop, bottom, right, leftPlace of the tooltip(Relative to the cursor)
typefalsedark, success, warning, error, infoTooltip theme
stylefalsestringcustom style

License

MIT