Overview
Company logos are stored as SVG components insrc/components/company-logos.tsx. This guide shows you how to add a new logo with proper accessibility and styling.
Logo Requirements
SVG format - Use SVG for scalability and styling flexibility
Accessible - Include proper title and ARIA attributes
Responsive - Set appropriate width and height
Theme-aware - Support both light and dark modes
Adding a Logo
Logo Template
Use this template when adding a new logo:src/components/company-logos.tsx
Template Attributes
Links the SVG to its title for screen readers
- Format:
"yourcompany-logo-title" - Must match the
idin the<title>element
Tailwind classes for theming
- For logos that need theme support:
"text-zinc-900 dark:text-zinc-100" - For colored logos: Use specific color classes or omit
Logo height in pixels
- Standard:
"30" - Adjust if needed for visual balance
Logo width in pixels
- Standard:
"30" - Can be different from height for aspect ratio
SVG coordinate system
- Format:
"0 0 [width] [height]" - Use the original SVG’s viewBox values
XML namespace for SVG
- Always:
"http://www.w3.org/2000/svg"
Real Examples
Let’s look at some real examples from the codebase:Simple Logo (Vercel)
A simple, theme-aware logo:src/components/company-logos.tsx
- Uses
fill="currentColor"to inherit text color - Theme-aware with
text-zinc-900 dark:text-zinc-100 - Simple title without id (acceptable for simple cases)
Colored Logo (Cloudflare)
A logo with specific colors:src/components/company-logos.tsx
- Wider aspect ratio (66x30)
- Uses specific color classes
- Includes transition for smooth color changes
Multi-Color Logo (Mintlify)
A logo with multiple colors and opacity:src/components/company-logos.tsx
- Multiple paths with different opacities
- Softer colors for a subtle look
- All paths use
currentColorfor theme support
Logo with Dark Mode Variant (Better Auth)
A logo that changes completely in dark mode:src/components/company-logos.tsx
- Different fill colors for light and dark modes
- Uses
classNameto switch colors - Inverted colors for contrast
Theme Support
Most logos should support both light and dark themes. There are several approaches:Approach 1: currentColor (Recommended)
UsecurrentColor with theme-aware text colors:
Approach 2: Class-based Colors
Use Tailwind classes directly on paths:Approach 3: Opacity Variations
Use opacity with currentColor:Approach 4: Specific Colors
Use specific colors that work in both modes:Sizing Guidelines
Standard Size
Most logos use a standard 30x30 size:Wider Logos
For horizontal logos, increase the width:Taller Logos
For vertical logos, increase the height:Accessibility
Title Element (Required)
Every logo must have a<title> element:
- Provides a text description for screen readers
- Should be the company name
- Must have an
idthat matches thearia-labelledbyattribute
ARIA Attributes
Links the SVG to its title element
Hides decorative logos from screen readers (use sparingly)Only use if the logo is purely decorative and the company name is shown in text nearby.
Specifies the element roleUsually not needed as
<svg> has implicit role of img.Optimizing SVGs
Before adding your logo, optimize it:Remove unnecessary attributes
Remove:
idattributes (except on title)classattributes from original SVGstyleattributes- XML comments
- Unnecessary
<g>wrappers
Simplify paths
Use tools like SVGOMG to:
- Merge paths where possible
- Remove redundant points
- Round numbers to reduce file size
Common Issues
Logo is too small/large
Logo is too small/large
Issue: Logo doesn’t match the size of other logosFix: Adjust the
width and height attributes:Logo is clipped or has extra space
Logo is clipped or has extra space
Issue: The
viewBox doesn’t match the logo’s actual boundsFix: Use the original SVG’s viewBox values or calculate the correct bounds:Logo doesn't support dark mode
Logo doesn't support dark mode
Issue: Logo uses hardcoded colors that don’t work in dark modeFix: Use one of the theme support approaches:
Logo is not accessible
Logo is not accessible
Issue: Screen readers can’t identify the logoFix: Add proper title and ARIA attributes:
Logo type doesn't match
Logo type doesn't match
Issue: The key in
companyLogos doesn’t match the logoType in your JSONFix: Make sure they match exactly:company.json
company-logos.tsx
Testing Your Logo
Best Practices
Use SVG format
SVG scales perfectly and can be styled with CSS
Support dark mode
Make sure your logo works in both light and dark themes
Keep it simple
Remove unnecessary elements and optimize paths
Add accessibility
Always include title and ARIA attributes
Use currentColor
Let the logo inherit text color for consistency
Match the size
Keep logos a consistent size (usually 30x30)
Next Steps
After adding your logo:- Make sure the
logoTypein your company JSON matches the key incompany-logos.tsx - Run
pnpm devand navigate to your company page - Test in both light and dark modes
- Test with a screen reader
- Submit your Pull Request
Adding Companies
Learn how to create company JSON files
Schema Validation
Understand how validation works