emptygif
Language: English

All languages and frameworks

Svelte component Svelte

A Svelte snippet for Svelte component that answers requests for /pixel.gif with the empty GIF, decoded once at startup.

Svelte component Svelte

File
Spacer.svelte
<script>
  const EMPTY_GIF = 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';

  let { width = 1, height = 1, ...rest } = $props();
</script>

<img src={EMPTY_GIF} {width} {height} alt="" aria-hidden="true" {...rest} />

We ran this snippet and compared the bytes it returned.

Official site: Svelte component