How to set up global layouts in Plasmic Studio?

If you are using code components, this might helps in hiding the navbar while rendering in editor.
https://docs.plasmic.app/learn/writing-code-components/#detect-if-your-component-is-rendering-in-plasmic-studio

hey @zonal_mammal sorry for the delay. I missed your response. I am using codegen, and I did try the inEditor context without any luck

Hey @warm_swallow,
I think Plasmic team can better leave an update on this part. I think the inEditor context isn’t working here because it’s only expected to be used in registered code components where as Layout component isn’t registered and it’s simply used in _app.tsx

Also, being used in _app.tsx, it should only be displayed in Page components and not in individual component artboards.

CC: @chungwu

I think I got something, Can you please try disabling the Layout wrapping for your host url.

For example, if your host url path is /plasmic-host then return <Component {…pageProps} /> directly without wrapping it in Layout. It should disable it hopefully.

// _app.tsx

const router = useRouter()

const DynamicLayout = router.pathname === "/plasmic-host" ? React.Fragment : Layout

return (
  <PlasmicRootProvider>
     <DynamicLayout>
        <Component {...pageProps} />
      </DynamicLayout>
  </PlasmicRootProvider>
)

this would hide the navbar completely everywhere in the studio

I guess for now its better than showing the nav bar on non-page components

thanks for your help