
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeYou can add a custom button to the Sanity Studio navbar by customizing the navbar component in your Studio configuration. Here's how to do it:
In your sanity.config.ts (or .js) file, you can override the navbar component using the studio.components configuration:
// sanity.config.ts
import {defineConfig, NavbarProps} from 'sanity'
import {Button} from '@sanity/ui'
function CustomNavbar(props: NavbarProps) {
return (
<>
{props.renderDefault(props)} {/* Render the default navbar with logo */}
<Button
as="a"
href="/"
target="_parent"
text="Return to Website"
tone="primary"
mode="ghost"
/>
</>
)
}
export default defineConfig({
// ... rest of your config
studio: {
components: {
navbar: CustomNavbar,
}
}
})The props.renderDefault(props) function renders the default navbar (including the Sanity logo), and you can add your custom button alongside it. Since your Studio is in an iframe, use target="_parent" to make the link navigate the parent window rather than just the iframe.
You can customize the button further using Sanity UI components:
tone to "default", "primary", "positive", etc.mode to "bleed", "ghost", or "default"icon proppadding and margin propsThe navbar component customization is part of the Studio Components API, which lets you override various parts of the Studio UI while keeping the default functionality intact.
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.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store