Recipes
How to find the best logo for your use case
This recipe explores an effective strategy for selecting the best logo to display in company listing apps, such as those used in fintech and other industries.
Retrieve the brand icon
JavaScript
const icon = brand.logos.find(({ type }) => type === 'icon')
Retrieve the dark logo
JavaScript
const logoDark = brand.logos.find(({ type, theme }) => type === 'logo' && theme === 'dark')
Retrieve the light logo
JavaScript
const logoLight = brand.logos.find(({ type, theme }) => type === 'logo' && theme === 'light')
Retrieve the dark symbol
JavaScript
const symbolDark = brand.logos.find(({ type, theme }) => type === 'logo' && theme === 'dark')
Retrieve the light symbol
JavaScript
const symbolLight = brand.logos.find(({ type, theme }) => type === 'logo' && theme === 'light')
Retrieve a specific format
JavaScript
const file = logo.formats.find(({ format }) => format === 'svg')
Find a logo with the best format
JavaScript
const priorityList = ['svg', 'webp', 'png', 'jpeg', 'jpg']
const file = priorityList.find(priorityFormat =>
logo.formats.some(({ format }) => format === priorityFormat)
)