0.0.4 • Published 3 years ago
@sato0130/svelte-tooltip v0.0.4
@sato0130/svelte-tooltip
Light weight svelte-action based tooltip.
Demo
https://svelte-tooltip-k-sato1995.vercel.app/
Installation
$ npm i @sato0130/svelte-tooltipor
$ yarn add @sato0130/svelte-tooltipUsage
- Import
SvelteTooltip.
import SvelteTooltip from '@sato0130/svelte-tooltip';- Use
SvelteTooltipin 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
| Name | isRequired | type | Description |
|---|---|---|---|
| body | true | string, SvelteComponent | Content in the tooltip |
| bodyAsHTML | false | false, true | Render the content as HTML |
| place | false | top, bottom, right, left | Place of the tooltip(Relative to the cursor) |
| type | false | dark, success, warning, error, info | Tooltip theme |
| style | false | string | custom style |
License
MIT