Update Svelte component style using on:mousemove directive

This page summarizes the projects mentioned and recommended in the original post on /r/sveltejs

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • Svelte

    Cybernetically enhanced web apps

  • You'll probably still want to attach your 'mousemove' event to document via addEventListener. You can do this in an onMount. Unlike for window, annoyingly svelte currently doesn't have a tag to attach the proper directives (see https://github.com/sveltejs/svelte/issues/3310)

  • svelte-flatlist

    A draggable, customizable, mobile-friendly menu that's simple and easy to use.

  • The "best" way I've found (best is subjective since theres a few ways to solve the problem), is to use Svelte Actions for times when whatever it is I'm trying to accomplish is generic enough to be reusable, but not too specific to the point it becomes too complex to manage. Using actions you can emit a custom event with whatever data you want (example could be mouse coordinates). Here's an example of how I used an action along with the Component I used it in.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts