1. Utilities
  2. windowSize

Utilities

windowSize

Reactive window size.

Demo

Width: undefined
Height: undefined

Usage

        <script>
  import { windowSize } from "sveltronics";
  import { onMount } from "svelte";

  let { width, height } = {};
  onMount(() => {
    ({ width, height} = windowSize());
  })

</script>

<div>
  <div>Width: {$width}</div>
  <div>Height: {$height}</div>
</div>