R
Refine

ask-any-question

Hide sidebar from refine component

Ffascinating-indigo12/20/2023
I am using <Refine /> component in the root of the app, and it automatically creates a sidebar with all the resources, how could I hide it? I need to completely remove the sidebar including logout butons
Kkapa.ai12/20/2023
Hi @Facu. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- To completely remove the sidebar from the <Refine /> component, you can customize the layout by using the Layout prop of the <Refine /> component. You can use the ThemedLayoutV2 component from the UI library you are using (Ant Design, Material UI, or Mantine) and pass a custom Sider prop to it. Here is an example of how to do it with Ant Design:
import { Refine } from "@refinedev/core";
import { Layout } from "@refinedev/antd";

const App: React.FC = () => {
return (
<Refine
// ...
>
<Layout
Sider={() => null}
>
{/* ... */}
</Layout>
</Refine>
);
};
import { Refine } from "@refinedev/core";
import { Layout } from "@refinedev/antd";

const App: React.FC = () => {
return (
<Refine
// ...
>
<Layout
Sider={() => null}
>
{/* ... */}
</Layout>
</Refine>
);
};
In this example, we are passing a function that returns null to the Sider prop of the Layout component. This effectively removes the sidebar from the layout. Please note that this will also remove the logout button since it is part of the sidebar. If you want to keep the logout button, you will need to implement it somewhere else in your layout. For more information, you can refer to the Refine documentation (https://refine.dev/docs/ui-integrations/ant-design/components/themed-layout/#sider). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
Kkapa.ai12/20/2023
<@411223164698492929> kapa.ai is still learning and improving, please let us know how it did by reacting below

Looking for more? Join the community!

R
Refine

ask-any-question

Join Server