Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/xelaok/svelte-watch-resize
- Owner: xelaok
- License: mit
- Created: 2019-09-08T23:52:27.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-09T00:11:47.000Z (about 5 years ago)
- Last Synced: 2024-10-11T07:52:21.406Z (about 1 month ago)
- Topics: element-resize, svelte
- Language: TypeScript
- Size: 3.91 KB
- Stars: 29
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
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}
```