How to replace the default Sanity logo in the studio with a custom logo.

7 replies
Last updated: Mar 21, 2024
Hi ,I want to replace the default sanity logo in the top left corner of my studio to my custom logo.
Anybody has tried it?
thanks
AI Update

Yes, you can definitely replace the default Sanity logo in the top left corner of your Studio with a custom logo! As of Sanity Studio v3.23.0, the way to do this has been updated.

Here's how to add your custom logo in your sanity.config.ts or sanity.config.js file:

import { defineConfig } from 'sanity'
import { MyLogo } from './components/MyLogo'

export default defineConfig({
  icon: MyLogo,
  // ...rest of your config
})

Then create your logo component (e.g., 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 - you can't increase the width beyond the square dimensions
  • If you need more control over the toolbar layout (like a wider logo), you'll need to create a custom Studio layout using Studio Components, which involves creating a wrapper for the Studio and designing your own toolbar

For most use cases, the simple icon property should work well. Just make sure your logo looks good in a square format!

If you want to explore more advanced customization options like custom colors and themes alongside your logo, you can also check out Sanity Themer, which is an open-source tool that helps you customize your Studio's appearance visually.

You can find more details in this community answer thread where this exact question was discussed.

Yeah, they updated the way this was done in v3.23.0
You now need to specify it as
icon
in your workspace config.
Something like this in
sanity.config.{ts,js}


import { MyLogo } from './components/MyLogo';
export default defineConfig({
  icon: MyLogo,
  ...restOfTheConfig
});

MyLogo.{tsx,jsx}

import logo from './logo.png?url';

export const MyLogo = (
  <img src={logo} alt='My Logo' width={25} height={25} />
);
Thank you for the solution.can we also increase the width of the icon? because its very small
No, it’s locked to a square - you can create a ‘wrapper’ for the studio and design your own toolbar if you’d like though
oh okay, thanks for the reply but its sound lil complicated.could you give me an example? or guide which i can follow
that would be super helpful
This is what mine looks like
its looks cool thanks for sharing, is there any guide available for customizing studio toolbar like you did?
This is where you want to look https://www.sanity.io/docs/studio-components

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.

Was this answer helpful?