I'm trying to create a project
Hello everyone, I'm trying to create a project but it only comes with the header, how do I get the sider, header layout, title
5 Replies
Hey @joaofgabriel! I'm the kapa.ai support bot. I've searched through the docs to try to answer your question. :wave:
----------------------
To create a project with a custom layout that includes the header, sider, and title, you can follow these steps:
1. First, create your refine project using the
create refine-app
command. This will set up your project with the necessary dependencies and configurations. You can follow the Quick Start Guide (https://refine.dev/docs/getting-started/quickstart) for more information on setting up your project.
2. After setting up your project, you can create custom components for the Header
, Sider
, and Title
. You can find examples of custom Header
components in the extracts from this source (https://refine.dev/blog/create-a-feedback-admin-panel-with-refine-and-strapi/) and this source (https://refine.dev/blog/refine-react-ant-design-admin-panel-framework/). For the Title
, you can refer to this extract (https://refine.dev/docs/advanced-tutorials/custom-layout).
3. Once you have created your custom components, you can pass them as properties to the Refine
component in your App.tsx
file. You can find an example of how to do this in this extract (https://refine.dev/docs/api-reference/core/components/refine-config).
Here's an example of how your App.tsx
file might look like:
```jsx
import { Refine } from "@pankod/refine";
import { CustomHeader } from "./components/CustomHeader";
import { CustomSider } from "./components/CustomSider";
import { CustomTitle } from "./components/CustomTitle";Quick Start Guide | refine
refine works on any environment that can run React (incl. CRA, Next.js, Remix, Vite etc.)
Create a Feedback Admin panel in 15 Minutes with Refine and Strapi ...
We will quickly create an api with Strapi and then develop its frontend with refine. Thus, let's see how an admin panel can be created in a very short time with the perfect harmony of Strapi and refine.
const App: React.FC = () => (
<Refine
...
Layout={({ children, Sider, Footer, Header, OffLayoutArea }) => (
<AntdLayout style={{ minHeight: "100vh", flexDirection: "row" }}>
{Sider && <CustomSider />}
<AntdLayout>
{Header && <CustomHeader />}
<AntdLayout.Content>
<div style={{ padding: 24, minHeight: 360 }}>
{children}
</div>
</AntdLayout.Content>
{Footer && <Footer />}
</AntdLayout>
{OffLayoutArea && <OffLayoutArea />}
</AntdLayout>
)}
/>
);
``
Make sure to replace
CustomHeader,
CustomSider, and
CustomTitle` with your actual custom components.
By following these steps, you should be able to create a project with a custom layout that includes the header, sider, and title.
----------------------<@890420278004420609> kapa.ai is still learning and improving, please let us how it did by reacting below
evident-indigo•2y ago
Hey @joaofgabriel,
You can use swizzle command for this purpose. It will copy the selected components to your project and you can modify it as you want.
You can find more information about swizzle: https://refine.dev/docs/packages/documentation/cli/#swizzle