Skip to main content

Install

Requires Svelte 5 (runes). The adapter uses createSubscriber from svelte/reactivity (available since 5.7.0).

createLogoSoup

The Svelte adapter exposes a createLogoSoup function that returns a reactive object. Reading its properties inside an $effect or template automatically subscribes to state changes.

Reactive Properties

The object returned by createLogoSoup() exposes these reactive getters: And these methods:

Reactive Options

Since $effect auto-tracks any reactive state ($state, $derived, $props) read inside it, changing any option value automatically re-triggers processing:

Dark Mode with Background Color

When displaying logos on a dark background, pass backgroundColor so Logo Soup can properly detect contrast and apply irradiation compensation:

Visual Center Alignment

Apply visual center alignment with the getVisualCenterTransform helper from the core package:
The function returns a CSS transform string like translate(0px, -2.3px) or undefined if no offset is needed.

Reusable Component

Wrap it in a reusable Svelte component:
Usage:

How It Works Under the Hood

The Svelte adapter uses createSubscriber from svelte/reactivity (5.7+) to bridge the core engine’s subscribe/getSnapshot interface into Svelte’s runes-based reactivity:
  • createSubscriber returns a function that, when called inside a reactive context ($effect, template expression, $derived), registers the caller as a subscriber
  • Each getter (isReady, normalizedLogos, etc.) calls subscribe() before reading from the engine, making it automatically reactive
  • The engine itself is not duplicated into $state — it remains the single source of truth, with createSubscriber acting as the bridge
  • No legacy store contract ($: or subscribe method) is used — this is pure Svelte 5 runes