Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

svelte-hover-draw-svg

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-hover-draw-svg

A lightweight Svelte component to draw SVG on hover.

  • 3.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Svelte MultiSelect
 Svelte Hover Draw SVG

A lightweight Svelte component to draw SVG on hover.

REPL Commitizen friendly NPM version npm bundle size CI Release license

Svelte MultiSelect

Features

  • 🤏 Lightweight: Wrapper component with only svelte as dev dependency
  • 😌 Straightforward: Just put your SVG or component with SVG under the component
  • 📦 Encapsulated: Expose hovering for extra hover effects & conditionals
  • 🛠 Customizable: CSS variable --duration to set the duration

Blog post @hashnode: Build a Svelte Component To Draw SVG On Hover

Install

npm install --save-dev svelte-hover-draw-svg

yarn add -D svelte-hover-draw-svg

pnpm add -D svelte-hover-draw-svg

Prerequisite:

SVG shape must have a stroke

<svg stroke="#000" stroke-width="2">
  <path />
</svg>

This library works better with "Outlined" SVGs.

Usage

  • Inline SVG:
<script>
  import HoverDrawSVG from 'svelte-hover-draw-svg';
</script>

<HoverDrawSVG>
  <svg>
    <path />
  </svg>
</HoverDrawSVG>
  • SVG Component (set draw time to 2s, default is 1s):
<script>
  import HoverDrawSVG from 'svelte-hover-draw-svg';
</script>

<HoverDrawSVG --duration="2">
  <SvgComponent />
</HoverDrawSVG>
  • Nested elements (expose hovering status):
<script>
  import HoverDrawSVG from 'svelte-hover-draw-svg';
</script>

<HoverDrawSVG let:hovering>
  <a href="/" class:hoverEffect={hovering}>
    <svg>
      <path />
    </svg>
  </a>
</HoverDrawSVG>

Keywords

FAQs

Package last updated on 28 Mar 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc