We use cookies to ensure you get the best experience on our website. Read our privacy policy

Skip to main content

Directory

Logo Component

The Logo component provides a flexible way to display your brand identity with automatic dark mode support. It intelligently handles logo variations and ensures optimal display across different color schemes.

  • Check Circle

    Dark Mode Support: Automatically switches between light and dark variants

  • Check Circle

    Responsive Design: Maintains aspect ratio across screen sizes

  • Check Circle

    Flexible Sizing: Adapts to container dimensions

  • Check Circle

    Fallback Handling: Gracefully handles missing dark mode variants

North Star Themes Logo
<Logo />

The component automatically handles dark mode switching, if you want to disable it, you can set the darkMode prop to false then the same image will be used in both themes:

Example with dark mode Example without dark mode
<Logo alt="Company Name" />
<!-- Without dark mode -->
<Logo darkMode={false} alt="Company Name" />
  1. Place your logo files in src/assets/logos/
    • Light theme: logo.png
    • Dark theme: logo-dark.png
src/
└── assets
└── logos
β”œβ”€β”€ logo.png
└── logo-dark.png
Logo Component Props Extends <div> HTMLElement
Prop Type Default Description
darkMode boolean true Enable dark mode variant switching
alt string CONFIG.BUSINESS_NAME Logo Alternative text for accessibility
  1. Image Preparation

    • Use PNG format for transparency support
    • Maintain consistent dimensions between variants
    • Optimize image files for web use
    • Ensure sufficient contrast in both modes
  2. Accessibility

    • Provide meaningful alt text
    • Consider color contrast for linked logos
    • Test navigation with keyboard controls
    • Ensure proper ARIA attributes
  3. Responsive Design

    • Test logo appearance at various sizes
    • Verify dark mode transitions
    • Ensure proper scaling behavior
    • Consider mobile viewports
  • Check Circle

    Uses Astro’s built-in Image component for optimization

  • Check Circle

    Dynamically imports dark mode variant

  • Check Circle

    Maintains aspect ratio through object-fit containment

  • Check Circle

    Gracefully falls back to light variant if dark is unavailable

Limited Time Launch Sale

Start building your branded website with our pre-built Logo component. Get the AstroJS starter template now and implement professional branding in minutes.

GET 60% OFF!
North Star Themes Logo

Subscribe to our newsletter

Get the latest AstroJS tips and tricks right to your inbox

Email: [email protected]

© 2025 North Star Themes

Web Kit Provided By North Star Themes