New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

@svelte-plugins/tooltips

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
t

@svelte-plugins/tooltips

A simple tooltip action and component designed for Svelte.

0.1.1
81

Supply Chain Security

91

Quality

82

Maintenance

100

Vulnerabilities

100

License

Version published
Weekly downloads
4.1K
-18.33%
Maintainers
1
Weekly downloads
 
Created
Issues
3

@svelte-plugins/tooltips

A simple tooltip action and component designed for Svelte.

Try it in the Svelte REPL.

Install

yarn add -D @svelte-plugins/tooltips

# or with NPM

npm i -D @svelte-plugins/tooltips

Using the Tooltip component

<script>
  import { Tooltip } from "@svelte-plugins/tooltips";
</script>

<Tooltip content="Hello world!">
 Check out my tooltip
</Tooltip>

Using the Tooltip action

<script>
  import { tooltip } from "@svelte-plugins/tooltips";
</script>

Checkout out my <u title="Hello World!" use:tooltip>tooltip</u>

Checkout out my <u use:tooltip={{ content: 'Hello World!' }}>tooltip</u>

API

Props

PropDescriptionValue
contentThe string or object containing componentref and propsstring
arrowIf false, the tooltip arrow will not be shown.boolean (default: true)
animationThe animation to apply to the tooltipstring (default: ``)
maxWidthThe max allowable width of the tooltip contentnumber (default: 200)
positionThe position where the tooltip should appear relative to its parentstring (default: top)
autoPositionAdjust tooltip position if viewport clipping occursstring (default: false)
Using components as content
PropDescriptionValue
content.componentSvelte componentcomponent (default: null)
content.propsAny component propetiesobject (default: null)
<script>
  import ComponentAsTooltip from './ComponentAsTooltip';
</script>

Checkout out my <span use:tooltip={{ content: { component: ComponentAsTooltip, props: { title: 'Hello World!' } } }}>tooltip</span>

Changelog

Changelog

License

MIT

FAQs

Package last updated on 22 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts