Implementation
Create a file at src/admin/AdminDashboard.tsx:
src/admin/AdminDashboard.tsx
'use client'; // For Nextjs
import { MarkusAdmin } from 'markus-react-admin-dashboard';
export default function AdminDashboard() {
return (
<MarkusAdmin
dataProvider={dataProvider}
mode={palleteMode}
locale={locale}
fullLocales={fullLocales}
logo={logo}
iconLogo={iconLogo}
translations={translations}
user={user}
logOut={logout}
title={title}
/>
);
}
Props
| Prop | Required | Type | Default | Description |
|---|---|---|---|---|
| dataProvider | Required | AdminNavigationTypes | - | The data provider for fetching resources |
| mode | Optional | string | 'light' | Color mode: light or dark |
| locale | Optional | string | 'en' | Language tag: 'en', 'de', 'it'... |
| fullLocales | Optional | AdminFullLocales[] | [{ name: 'English', value: 'en' }] | Language selection |
| logo | Optional | RactNode | '../assets/images/logo/logo.png' | Customized project logo |
| iconLogo | Optional | ReactNode | '../assets/images/logo/icon-logo.png' | Customized project icon logo |
| translations | Optional | Object[] | Default message translations | Info, warning... messages |
| user | Optional | {} | Basic data of a registered user with admin privileges | |
| logout | Optional | Function | - | A function that logs out an admin control panel user |
| title | Optional | AdminTitle | { en: ''} | Custom admin panel title |