Skip to main content
A company logo that looks right on a white page often disappears on a dark one, because most wordmarks are drawn in black or a deep brand color. The Logo API serves two versions of each logo through the theme option, so the fix is to request the version that matches your background and switch between the two when your app’s theme changes.

Which theme to request

The theme value names the color of the logo rather than the color of the background, which is the opposite of what many people expect, so a dark page needs theme/light:
A URL without theme returns the version made for light backgrounds, so existing logo URLs only need a change where they sit on a dark surface.

Follow the system theme

When your site follows the visitor’s operating system setting, a <picture> element does the switching without any JavaScript. The browser requests only the version that matches, and it swaps the image as soon as the system theme changes:
Request twice the height you display, as with h/64 for a 32-pixel logo here, so the logo stays sharp on high-density screens.

Follow your app’s theme toggle

Apps with their own light and dark switch usually mark the theme with a class on the <html> element, and a <picture> media query can’t see that class because it only reads the system setting. The simplest approach in that case is to render both versions and let CSS show the right one:
With Tailwind, the same thing is dark:hidden on the first image and hidden dark:inline on the second. Hiding an image with CSS doesn’t stop the browser from downloading it, so every logo costs two requests this way. For long lists, pick a single URL from your theme state instead, as the component in the next section does.

When a brand has no light version

Most well-known brands have both versions, but some only have one, and Plausible and ING, for example, have no light logo at the time of writing. A request for a version that doesn’t exist returns the default fallback, which is the Brandfetch logo, so check whether the light version exists before deciding which URL to render. The Brand API answers that question in one request. Its logos array lists every logo the brand has along with its theme, where light marks a logo made for dark backgrounds, so a brand has a light version when one of its logo entries has that theme. The Brand API needs your secret key, so make the call on your server, and since a brand’s logos rarely change, store the result with the company record or cache it rather than calling on every page view:
brand.ts
Whenever the light version exists, request it, since it’s the version the brand drew for dark backgrounds. Only when it’s missing does it make sense to turn the regular logo white with a CSS filter:
The filter paints every visible pixel white, which works well for simple one-color wordmarks but has some risks. A logo built from several colored shapes loses its inner detail and becomes one flat white silhouette, a logo drawn on a filled background turns into a solid white block, and the brand’s own colors disappear, which some brand guidelines don’t allow. That’s why the filter belongs in the fallback path only, after the check, rather than on every logo in dark mode. With the answer known before anything renders, the component that shows the logo needs no state or error handling. It picks the URL from hasLight and from dark, which comes from whatever holds your theme, such as resolvedTheme === "dark" from next-themes:
BrandLogo.tsx
With Tailwind, the same filter is brightness-0 invert. If you don’t use the Brand API, adding fallback/404 to the theme/light URL makes the request fail when that version is missing, which you can catch with the image’s onError handler, though the logo then has to load once before your page knows which version to show.

Icons in dark mode

Where a logo only needs to identify the company, as in a list, a table, or an avatar, the square icon type avoids the problem altogether. Icons are the images brands use as profile pictures, so they usually come with their own background color and read clearly on light and dark pages alike, and a slightly rounded corner helps them sit on either surface:
For a grid of customer or partner logos in both themes, see Logo walls, which combines the theme switch with sizing that keeps logos of different shapes looking even.

FAQ

Add theme/light to the Logo API URL, as in https://cdn.brandfetch.io/domain/nike.com/theme/light/logo?c=BRANDFETCH_CLIENT_ID, which returns the version of the logo made for dark backgrounds.
The value describes the logo, not the background. theme/dark is a dark logo for light backgrounds, and theme/light is a light logo for dark backgrounds.
The brand has no light version, so the request returned the default fallback. Check the Brand API’s logos array for a logo with theme: "light" before rendering, and when there isn’t one, show the regular logo turned white with filter: brightness(0) invert(1), as in the component above.
Use a <picture> element with a prefers-color-scheme: dark source when your site follows the system setting. When your app has its own theme toggle, pick the URL from your theme state, or render both versions and hide one with CSS.
For most brands, yes. theme/light returns the version for dark backgrounds, which for most wordmarks is all white. A few brands don’t have one, and the Brand API’s logos array tells you when that’s the case. For those, a CSS filter can turn the regular logo white, though it flattens multicolor logos, so use it only as a fallback.

Logo API parameters

Theme, type, size, and fallback options for every logo URL

Logo walls

Customer and partner logo grids that work in both themes