ExamplesInteraction

Contextual Zoom

This example shows how the current zoom level can be used by a node to decide which content to show. We can access the zoom inside the viewport writable via the useSvelteStore hook to update our custom node whenever the zoom changes.

<script lang="ts">
const data: string = "world";
</script>

<h1>Hello {data}</h1>

<style>
h1 {
  font-size: 1.5rem;
}
</style>
Read-only
⚠️
To surpress unknown prop warnings in the browser console, please refer to the guide.