v0.0.14
attachments

scrolllock

Prevents page scrolling while an element is active by locking the document’s scroll. Commonly used for modals and overlays.

Usage

<script>
    import { scrolllock } from 'svxui';
</script>

<div
    {@attach scrolllock({
        // Enable/disable scroll lock
        enabled: true
    })}
>
    {#each { length: 200 }, i (i)}
        <div>Item {i}</div>
    {/each}
</div>

API Reference

ScrolllockOptions

PropertyTypeDefaultDescription
enabled
boolean
trueEnable/disable scroll lock