Dashboard

This section provides guidance on laying out a dashboard page.

Overview

Dashboard layout is a user interface design used to display important information or key performance indicators (KPIs) in a clear and concise manner. It is often used in business applications, data visualization tools, and analytics software to provide users with a real-time overview of their performance metrics.

How to use

Here we use dashboard layout. The installation method is as follows below.

Dashboard layout use mode Per-Page Layouts

Dashboard layout component is split into several sections:

  • Header: Component which represents the main navigation bar of the layout.

  • Main: Contains the content of each page and all prop passed from the page component.

  • Sidebar: Component which represents the sidebar navigation of the layout.

  • Footer: Component which represents the footer of the layout.

Step 1: Create the layout split component

First, create a few new files in src/layouts/DashboardLayout directory. This will be the parent folder component that wraps around each component layout.

layouts/DashboardLayout
β”œβ”€β”€ Header
β”‚   β”œβ”€β”€ <another split code>
β”‚   └── index.tsx
β”œβ”€β”€ Main
β”‚   β”œβ”€β”€ <another split code>
β”‚   └── index.tsx
β”œβ”€β”€ Sidebar
β”‚   β”œβ”€β”€ <another split code>
β”‚   └── index.tsx
β”œβ”€β”€ Footer
β”‚   β”œβ”€β”€ <another split code>
β”‚   └── index.tsx
└── index.tsx

In each split it can be chunked again into smaller code sections.

Step 2: Create the parent layout component

Next, create a new file for parent layout component, such as index.tsx, also in your src/layouts/DashboardLayout directory.

Step 3: Create the Page Component

Next, create a new file for your page component, such as index.tsx, also in your src/components/page/Homepage directory. This component will be wrapped by the DashboardLayout component.

Step 4: Add the Page to Your App

Finally, create a new file for your page component, such as index.tsx, also in your src/pages directory.

Last updated