How to modify Sanity logo in backend on v3?
14 replies
Last updated: Feb 16, 2024
AI Update
Yes! In Sanity Studio v3, you can customize the logo in the backend by adding an icon property to your workspace configuration in sanity.config.ts (or .js). This approach was introduced in v3.23.0.
Here's how to do it:
In your sanity.config.ts file:
import { defineConfig } from 'sanity'
import { MyLogo } from './components/MyLogo'
export default defineConfig({
icon: MyLogo,
// ...rest of your config
})Create your logo component (MyLogo.tsx or MyLogo.jsx):
import logo from './logo.png?url'
export const MyLogo = (
<img src={logo} alt='My Logo' width={25} height={25} />
)Important notes:
- The icon is locked to a square format by default, so keep your logo dimensions balanced
- If you need more control over the navbar appearance (like a wider logo), you can create a custom navbar component using the Studio Components API, though this is more complex
You can find working examples on GitHub by searching for sanity.config.ts files with the icon: property. The defineConfig documentation also covers workspace configuration options in detail.
Show original thread14 replies
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.