Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xelaok/svelte-watch-resize

Watch element resize in Svelte
https://github.com/xelaok/svelte-watch-resize

element-resize svelte

Last synced: 1 day ago
JSON representation

Watch element resize in Svelte

Awesome Lists containing this project

README

        

## svelte-watch-resize ([npm](https://www.npmjs.com/package/svelte-watch-resize), [demo](https://svelte.dev/repl/76389084c0e241e8b1e5bd910897c468))
Watch element resize in Svelte

## Installation

```bash
npm i -S svelte-watch-resize
```

## Usage

```html

import { watchResize } from "svelte-watch-resize";

let leftWidth;
let mainWidth;

function handleLeftResize(node) {
leftWidth = node.clientWidth;
}

function handleMainResize(node) {
mainWidth = node.clientWidth;
}



{leftWidth}


{mainWidth}


```