Logo component displaying your app logo and name with configurable size and variant.
Location: src/components/ui/Logo.tsx
Overview
The Logo component displays your app's logo image and name together. It automatically uses logo files from the /public folder and supports multiple sizes and color variants (default and white). The component links to the homepage and uses the app name from config.ts.
Quick Customization
This component is highly customizable:
- Sizes - 3 size options (sm, md, lg)
- Variants - Default (dark) or white variant for dark backgrounds
- Logo files - Replace
/logo.svgand/logo_w.svgin public folder - App name - Uses
config.appNameautomatically - Styling - Additional CSS classes for custom styling
Usage
import Logo from "@/components/ui/Logo";
<Logo />
Props
| Prop | Type | Default | Description |
|---|---|---|---|
size | "sm" | "md" | "lg" | "md" | Logo size |
variant | "default" | "white" | "default" | Logo color variant |
className | string | "" | Additional CSS classes |
Examples
Basic Usage
import Logo from "@/components/ui/Logo";
// Default logo (dark variant)
<Logo />
// White logo variant (for dark backgrounds)
<Logo variant="white" />
Size Variants
// Small logo
<Logo size="sm" />
// Medium logo (default)
<Logo size="md" />
// Large logo
<Logo size="lg" />
Variant Examples
// Default variant (dark logo)
// Uses /logo.svg
<Logo variant="default" />
// White variant (light logo for dark backgrounds)
// Uses /logo_w.svg
<Logo variant="white" />
Common Use Cases
// Header logo (default, medium size)
<Logo />
// Footer logo (white variant, small size)
<Logo variant="white" size="sm" />
// Dark background (white variant)
<header className="bg-base-200">
<Logo variant="white" />
</header>
// Light background (default variant)
<header className="bg-base-100">
<Logo variant="default" />
</header>
// Custom styling
<Logo className="hover:opacity-80 transition-opacity" />
Setup
1. Add Logo Files
Add your logo files to the public/ folder:
public/
logo.svg # Default logo (for light backgrounds)
logo_w.svg # White logo (for dark backgrounds)
File requirements:
- SVG format recommended (scales perfectly)
- PNG format also works
- Ensure both variants match in design (just color difference)
2. Configure App Name
The logo uses config.appName automatically. Update in config.ts:
// config.ts
const config = {
appName: "Your App Name", // This appears next to the logo
// ...
};
Component Structure
interface LogoProps {
size?: "sm" | "md" | "lg";
variant?: "default" | "white";
className?: string;
}
Size behavior:
sm: Logo 24px, texttext-basemd: Logo 32px, texttext-lg(default)lg: Logo 40px, texttext-xl
Variant behavior:
default: Uses/logo.svg(dark logo for light backgrounds)white: Uses/logo_w.svg(light logo for dark backgrounds)
Styling Notes
- Logo image: Uses Next.js
Imagecomponent for optimization - Text: Uses
font-extraboldfor app name - Link: Wraps logo and text in a
Linkto homepage - Priority: Logo images use
priorityfor faster loading - Responsive: Adapts to container size
Best Practices
- Match backgrounds - Use
variant="white"on dark backgrounds,variant="default"on light - Consistent sizing - Use same size across your app (typically
md) - SVG format - Prefer SVG for crisp logos at any size
- Both variants - Provide both logo variants for flexibility
- Homepage link - Component links to
/(homepage) by default
Tips
- Header: Usually
size="md"with appropriate variant for header background - Footer: Often
size="sm"withvariant="white"for dark footers - Responsive: Logo sizes adapt automatically to container
- Custom styling: Use
classNameprop to add margins, hover effects, etc. - Accessibility: Component includes proper alt text and title attributes
Learn More
- Header Component - Uses Logo component
- Footer Component - Uses Logo component
- UI Components Overview - All available UI components