svelte-observe-resize Svelte Themes

Svelte Observe Resize

Svelte 3 action to use the Resize Observer API

svelte-observe-resize

A Svelte 3 action to use the resize observer for a specific element.

Install

npm install svelte-observe-resize --save-dev

Usage

<script>
  import observeResize from 'svelte-observe-resize';

  function handleResize() {
    // called when element is resized
  }
</script>

<main>
  <div use:observeResize on:resize={handleResize}></div>
</main>

Top categories

Loading Svelte Themes