Add navigation items
How to add a new navigation items?
I want to add a navigation item that redirect user to my page, how can I do that?
I want to add a navigation item that redirect user to my page, how can I do that?
resources property on the <Refine> component. The <Sider> component shows the resources whose list property is set. So, you can have an extra navigation link by adding a resource with the list attribute.render property of the <Sider> component. The render property is a function that receives an object with the items and logout properties. The items property is the list of navigation items and the logout property is the logout button.name property to "name/dashboard" in the resources prop of the <Refine> component. However, the name property is typically used to identify the resource and is not directly related to the navigation link. The navigation link is determined by the list property. Here's an example:list property should correspond to the route of your page in your application. If you want the navigation link to redirect to a different page, you should adjust the list property accordingly.resourcesresources<Sider><Sider>listlistlistlistlistitemsitemsname="name/dashboard""name/dashboard"import { Refine } from "@refinedev/core";
<Refine
...
resources={[
{
name: "dashboard",
list: "/",
meta: {
label: "Dashboard",
icon: "🏠",
},
},
]}
/>; import { Layout, Sider } from "@refinedev/antd";
const CustomSider = () => {
return (
<Sider
render={({ items, logout }) => {
return (
<>
<a href="<https://refine.dev/">👋> Navigation Link</a>
{items}
{logout}
</>
);
}}
/>
);
};
const CustomLayout = () => {
return <Layout Sider={CustomSider}>...</Layout>;
}; import { Refine } from "@refinedev/core";
<Refine
...
resources={[
{
name: "name/dashboard",
list: "/",
meta: {
label: "Dashboard",
icon: "🏠",
},
},
]}
/>;