Skip to main content

Install

Requires Vue 3.5 or later.

useLogoSoup Composable

Reactive Options

Every option accepts a plain value, a ref, or a getter function (MaybeRefOrGetter). The composable auto-tracks dependencies via watchEffect and re-processes whenever any option changes.

Options Type

All shared options are supported. Each is unwrapped with Vue’s toValue() internally.

Return Value

All return values are reactive. Reading them in a template or watchEffect automatically tracks changes.

Visual Center Alignment

Apply visual center alignment with the getVisualCenterTransform helper from the core package:

Using in Effect Scopes

The composable uses onScopeDispose (not onUnmounted) for cleanup, so it works correctly inside any Vue effect scope, not just components. This means you can use it in composables that create their own effectScope:

How It Works Under the Hood

The Vue adapter creates a core createLogoSoup engine instance and bridges it to Vue’s reactivity system:
  • shallowRef holds the engine’s state snapshot (not ref, since the snapshot is an immutable object that doesn’t need deep reactivity)
  • watchEffect auto-tracks which options are read and re-runs engine.process() when they change
  • onScopeDispose unsubscribes and destroys the engine when the scope is torn down
  • computed refs derive convenience properties (isLoading, isReady, etc.) from the shallow ref