Skip to main content

Install

Requires solid-js 1.9 or later.

useLogoSoup

The Solid adapter wraps the core engine using from(), Solid’s built-in primitive for external store subscriptions. Options are passed as a getter function so Solid can track reactive dependencies inside it.

Reactive Options

Options are passed as a getter function () => ProcessOptions. This is the standard Solid pattern for reactive props. Any signals read inside the getter are automatically tracked:
Internally, createEffect re-evaluates the getter whenever any signal it reads changes, then calls engine.process() with the new options.

Return Value

The return value is an object with reactive getters:
These are getters, not signals. You read them as properties (result.isReady), not function calls (result.isReady()). Each getter internally reads a signal created by from(), so they’re fully reactive in Solid’s tracking system.

Visual Center Alignment

Apply visual center alignment with the getVisualCenterTransform helper:

Dark Mode

Pass backgroundColor so Logo Soup can detect contrast on opaque logos and apply irradiation compensation:

Cleanup

The engine is automatically destroyed when the owning reactive scope is disposed (via onCleanup). You don’t need to call destroy() manually in components. If you use useLogoSoup outside a component (e.g., in a createRoot), make sure to dispose the root when you’re done:

How It Works Under the Hood

The Solid adapter uses three Solid primitives:
  • from() — Bridges the engine’s subscribe/getSnapshot interface into a Solid signal. from() accepts a producer function (set) => unsubscribe and returns a read-only accessor.
  • createEffect() — Re-runs when any signal read inside the options getter changes, calling engine.process() with the new values.
  • onCleanup() — Destroys the engine when the reactive scope is torn down.