Install
LogoSoup Component
The fastest way to get started. Drop it in and it handles everything:null if all images fail to load.
Component Props
All shared options are supported as props, plus these React-specific ones:| Prop | Type | Default | Description |
|---|---|---|---|
gap | number | string | 28 | Space between logos |
alignBy | AlignmentMode | "visual-center-y" | How to align logos |
renderImage | (props) => ReactNode | <img> | Custom image renderer |
className | string | — | Container class name |
style | CSSProperties | — | Container inline styles |
onNormalized | (logos) => void | — | Callback when normalization completes |
useLogoSoup Hook
For custom layouts, use the hook directly:Return Value
| Property | Type | Description |
|---|---|---|
isLoading | boolean | true while images are being loaded and measured |
isReady | boolean | true when all logos are normalized and ready to render |
normalizedLogos | NormalizedLogo[] | The processed logos with computed dimensions |
error | Error | null | Set if all images fail to load |
Custom Image Component
UserenderImage to integrate with Next.js Image, Remix, or add custom attributes:
Next.js Image
Lazy loading
Visual Center Alignment
When using the hook, apply visual center alignment withgetVisualCenterTransform:
<LogoSoup> component applies this automatically via the alignBy prop.
SSR
The hook provides agetServerSnapshot that returns an idle state during server rendering. Logos are always processed client-side (canvas is required). The component renders an empty container on the server and hydrates with normalized logos on the client.
How It Works Under the Hood
The React adapter usesuseSyncExternalStore to subscribe to the core engine. The engine is created once in a useRef and destroyed on unmount. The logos array reference is stabilized internally (deep comparison by src) to prevent infinite re-render loops when consumers pass inline array literals.