Images
Learn how to customize the images in your MkSaaS website
This guide covers the image system in your MkSaaS website, focusing on how to configure and customize logos, favicons, and other image assets.
Core Features
The MkSaaS template includes a flexible image system that allows you to:
- Configure logos for both light and dark modes
- Set up social media preview images (Open Graph)
- Customize favicons and browser icons
- Organize and access image assets efficiently
Image Configuration
Images are primarily configured in the website.tsx
configuration file.
Configuration Settings
Configuration Options:
Property | Description |
---|---|
ogImage | The Open Graph image used for social media previews when sharing the website |
logoLight | The logo displayed in light mode |
logoDark | The logo displayed in dark mode |
Image Directory Structure
Image assets are primarily stored in the public
directory, which is directly accessible from the browser.
Main Image Assets
The following image assets are typically stored in the root of the public directory:
- Main Logos:
logo.png
(light mode) andlogo-dark.png
(dark mode) - Open Graph Image:
og.png
for social media previews - Favicon Assets: Various sizes of favicons and browser icons
Additional Image Directories
For better organization, you can create subdirectories within the public folder:
/public/images/
- For general website images/public/blocks/
- For section-specific images/public/svg/
- For SVG assets
Customizing Logos
Logo Requirements
For the best display across the website, logos should:
- Be in PNG format with transparency
- Have a consistent height (the width can vary)
- Be prepared in both light and dark versions for different themes
Creating Custom Logos
To create a professional logo for your website:
- Use a Logo Creation Tool: We recommend Ray.so Icon Maker for creating simple, clean logos
- Export your logo in PNG format with transparency
- Create two versions: one for light mode and one for dark mode
- Place both files in your
/public
directory
Updating Logo Configuration
After creating your custom logos:
- Save your light mode logo as
/public/logo.png
- Save your dark mode logo as
/public/logo-dark.png
- Optionally update the paths in
website.tsx
if you used different filenames or locations:
Customizing Favicons
Favicons are the small icons displayed in browser tabs, bookmarks, and when adding your site to a mobile home screen.
Favicon Files
A complete favicon set includes several files:
favicon.ico
- Traditional favicon (16x16, 32x32, 48x48px)favicon-16x16.png
- 16x16 pixel PNG faviconfavicon-32x32.png
- 32x32 pixel PNG faviconapple-touch-icon.png
- 180x180 pixel icon for iOSandroid-chrome-192x192.png
- Icon for Android (192x192 pixels)android-chrome-512x512.png
- Larger icon for Android (512x512 pixels)
Creating Custom Favicons
To create a complete set of favicon files:
- Design a simple, recognizable icon (ideally square)
- Use Favicon.io Converter to generate a complete set of favicons
- Upload your image to the converter
- Download the generated zip file containing all favicon formats
- Extract and place all files in the root of your
/public
directory
Favicon HTML
The favicon files are automatically linked in your HTML via the following tags in MkSaaS boilerplate, so you don't need to add them manually.
These links are typically included in the <head>
section of your application's HTML.
Creating an Open Graph Image
The Open Graph image (og.png
) is displayed when your website is shared on social media platforms.
Open Graph Image Guidelines
For optimal display across platforms:
- Use dimensions of 1200×630 pixels (ratio of 1.91:1)
- Keep important content in the central area
- Include your logo, website name, and possibly a tagline
- Use colors consistent with your brand
Updating Open Graph Image
- Create your Open Graph image using a design tool
- Save it as
og.png
- Place it in the root of your
/public
directory - Update the configuration in
website.tsx
if needed:
Best Practices
- Image Optimization: Always compress images before adding them to your project
- Responsive Images: Use the Next.js Image component for automatic responsive handling
- SVG for Icons: Use SVG format for icons and simple graphics
- Consistent Styling: Maintain consistent dimensions and styling for logos across the site
- Alt Text: Always include descriptive alt text for accessibility
- File Size: Keep image file sizes as small as possible for better performance
- Format Selection: Use WebP or AVIF formats when possible for better compression
- Image Dimensions: Store images at their maximum required dimensions, letting Next.js handle resizing
Troubleshooting
Images Not Displaying
If your images aren't displaying correctly:
- Verify the file paths in your
website.tsx
configuration - Check that image files exist in the correct location (case-sensitive)
- Clear your browser cache and reload the page
- Verify the image dimensions and format are supported
Favicon Not Showing
If your favicon isn't displaying:
- Check that all favicon files are in the root of your public directory
- Verify that the HTML links are correctly set up
- Force refresh your browser (Ctrl+F5 or Cmd+Shift+R)
- Check browser developer tools for any 404 errors
Next Steps
Now that you understand how to work with images in MkSaaS, explore these related topics: