@sato0130/svelte-tooltip
v0.0.4
Published
![npm bundle size](https://img.shields.io/bundlephobia/minzip/@sato0130/svelte-tooltip) ![npm](https://img.shields.io/npm/v/@sato0130/svelte-tooltip?color=green)
Downloads
12
Maintainers
Readme
@sato0130/svelte-tooltip
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
- Import
SvelteTooltip
.
import SvelteTooltip from '@sato0130/svelte-tooltip';
- 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
| 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