Start with company names and verified domains, then add a logo to each row. Keep the directory useful when an image is missing, a company changes its name, or the first match belongs to a parent company.
Vizzy uses company branding in profiles and job boards. This recipe applies that pattern to a React directory.
Logo Link uses a public client ID. Configure allowed referring domains in the Logo Link dashboard, including the domains used for development and production. Keep secret API keys on the server when using Brand retrieval.
Embed Logo Link images directly. Do not download, persist, or rehost the returned image files. Normal browser and CDN caching directed by the response headers is allowed.
Use your own company ID as the record key. A domain is an input to logo lookup; it should not replace the identity of an existing directory entry.
Validate domains when importing or editing a company: accept a hostname such as stripe.com, and keep paths, email addresses, and unrelated platform domains out of the lookup field. Confirm the company when several entities share a name.
This component receives persisted company records and an edit callback from your application. Copy Company and logoUrl above into the same module. The component key resets a failed image when the domain or display settings change.
"use client";
import { useState } from "react";
function CompanyLogo({
company, src, wordmark,
}: { company: Company; src: string | null; wordmark: boolean }) {
const [failed, setFailed] = useState(false);
const initials = company.name.trim().slice(0, 2).toUpperCase() || "?";
const width = wordmark ? 112 : 40;
return (
<span style={{ width, height: 40, display: "grid", placeItems: "center" }}>
{src && !failed ? (
<img
src={src}
alt={`${company.name} logo`}
width={width}
height={40}
loading="lazy"
decoding="async"
style={{ objectFit: "contain", maxWidth: "100%" }}
onError={() => setFailed(true)}
/>
) : (
<span aria-hidden="true">{initials}</span>
)}
</span>
);
}
export function CompanyDirectory({
companies, publicClientId, onEdit,
}: {
companies: Company[];
publicClientId: string;
onEdit: (company: Company) => void;
}) {
const [theme, setTheme] = useState<"light" | "dark">("light");
const [type, setType] = useState<"icon" | "wordmark">("icon");
return (
<section style={{
background: theme === "dark" ? "#171717" : "#ffffff",
color: theme === "dark" ? "#fafafa" : "#171717",
padding: 24,
}}>
<button onClick={() => setTheme(theme === "light" ? "dark" : "light")}>
Use {theme === "light" ? "dark" : "light"} background
</button>
<button onClick={() => setType(type === "icon" ? "wordmark" : "icon")}>
Show {type === "icon" ? "wordmarks" : "icons"}
</button>
<ul style={{ listStyle: "none", padding: 0 }}>
{companies.map((company) => {
const domain = company.domainOverride ?? company.domain;
const src = domain && !company.hideLogo
? logoUrl(domain, publicClientId, theme, type)
: null;
return (
<li key={company.id} style={{
display: "flex", alignItems: "center", gap: 16, padding: "12px 0",
flexWrap: "wrap",
}}>
<CompanyLogo
key={src ?? "fallback"}
company={company}
src={src}
wordmark={type === "wordmark"}
/>
<span>{company.name}</span>
<button onClick={() => onEdit(company)}
aria-label={`Edit brand for ${company.name}`}>
Edit brand
</button>
</li>
);
})}
</ul>
</section>
);
}
"use client";
import { useState } from "react";
function CompanyLogo({
company, src, wordmark,
}: { company: Company; src: string | null; wordmark: boolean }) {
const [failed, setFailed] = useState(false);
const initials = company.name.trim().slice(0, 2).toUpperCase() || "?";
const width = wordmark ? 112 : 40;
return (
<span style={{ width, height: 40, display: "grid", placeItems: "center" }}>
{src && !failed ? (
<img
src={src}
alt={`${company.name} logo`}
width={width}
height={40}
loading="lazy"
decoding="async"
style={{ objectFit: "contain", maxWidth: "100%" }}
onError={() => setFailed(true)}
/>
) : (
<span aria-hidden="true">{initials}</span>
)}
</span>
);
}
export function CompanyDirectory({
companies, publicClientId, onEdit,
}: {
companies: Company[];
publicClientId: string;
onEdit: (company: Company) => void;
}) {
const [theme, setTheme] = useState<"light" | "dark">("light");
const [type, setType] = useState<"icon" | "wordmark">("icon");
return (
<section style={{
background: theme === "dark" ? "#171717" : "#ffffff",
color: theme === "dark" ? "#fafafa" : "#171717",
padding: 24,
}}>
<button onClick={() => setTheme(theme === "light" ? "dark" : "light")}>
Use {theme === "light" ? "dark" : "light"} background
</button>
<button onClick={() => setType(type === "icon" ? "wordmark" : "icon")}>
Show {type === "icon" ? "wordmarks" : "icons"}
</button>
<ul style={{ listStyle: "none", padding: 0 }}>
{companies.map((company) => {
const domain = company.domainOverride ?? company.domain;
const src = domain && !company.hideLogo
? logoUrl(domain, publicClientId, theme, type)
: null;
return (
<li key={company.id} style={{
display: "flex", alignItems: "center", gap: 16, padding: "12px 0",
flexWrap: "wrap",
}}>
<CompanyLogo
key={src ?? "fallback"}
company={company}
src={src}
wordmark={type === "wordmark"}
/>
<span>{company.name}</span>
<button onClick={() => onEdit(company)}
aria-label={`Edit brand for ${company.name}`}>
Edit brand
</button>
</li>
);
})}
</ul>
</section>
);
}
theme describes the background where the image will appear: light prefers a dark asset, and dark prefers a light asset. It does not recolor the company’s logo. Keep the company name visible even when every image is blocked.
Connect Edit brand to a form that can change the lookup domain or hide the logo. Save those decisions against the company ID in your database, with the editor and update time. Reload the saved record after a successful edit.
On automatic enrichment, update domain but leave domainOverride and hideLogo untouched. Provide a separate Use automatic branding action that clears the override. This lets a correction survive a refresh without preventing future automatic updates.
A logo does not establish affiliation, endorsement, or legal identity. Keep any such claims in separately verified directory fields.
Try the directory with a known domain, no domain, and a deliberately unavailable image. Switch between light and dark backgrounds and between icons and wordmarks. Save a corrected domain, reload the page, then run enrichment again: the correction should remain.
Configure the public client ID, referring domains, and image parameters.
Use reviewed brand assets in reports and proposals.