-
-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add DashboardLayout component to @toolpad/core (#3554)
- Loading branch information
1 parent
282d1b7
commit 6174b03
Showing
27 changed files
with
1,181 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Dashboard Layout API | ||
|
||
<p class="description">DashboardLayout API reference</p> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
docs/data/toolpad/core/components/dashboard-layout/DashboardLayoutBasic.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/material/Box'; | ||
import Typography from '@mui/material/Typography'; | ||
import DashboardIcon from '@mui/icons-material/Dashboard'; | ||
import ShoppingCartIcon from '@mui/icons-material/ShoppingCart'; | ||
import BarChartIcon from '@mui/icons-material/BarChart'; | ||
import DescriptionIcon from '@mui/icons-material/Description'; | ||
import LayersIcon from '@mui/icons-material/Layers'; | ||
import { AppProvider } from '@toolpad/core/AppProvider'; | ||
import { DashboardLayout } from '@toolpad/core/DashboardLayout'; | ||
|
||
const NAVIGATION = [ | ||
{ | ||
kind: 'header', | ||
title: 'Main items', | ||
}, | ||
{ | ||
title: 'Dashboard', | ||
icon: <DashboardIcon />, | ||
}, | ||
{ | ||
title: 'Orders', | ||
icon: <ShoppingCartIcon />, | ||
}, | ||
{ | ||
kind: 'divider', | ||
}, | ||
{ | ||
kind: 'header', | ||
title: 'Analytics', | ||
}, | ||
{ | ||
title: 'Reports', | ||
icon: <BarChartIcon />, | ||
children: [ | ||
{ | ||
title: 'Sales', | ||
icon: <DescriptionIcon />, | ||
}, | ||
{ | ||
title: 'Traffic', | ||
icon: <DescriptionIcon />, | ||
}, | ||
], | ||
}, | ||
{ | ||
title: 'Integrations', | ||
icon: <LayersIcon />, | ||
}, | ||
]; | ||
|
||
export default function DashboardLayoutBasic() { | ||
return ( | ||
<AppProvider navigation={NAVIGATION}> | ||
<DashboardLayout> | ||
<Box | ||
sx={{ | ||
py: 4, | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
}} | ||
> | ||
<Typography>Dashboard content goes here.</Typography> | ||
</Box> | ||
</DashboardLayout> | ||
</AppProvider> | ||
); | ||
} |
70 changes: 70 additions & 0 deletions
70
docs/data/toolpad/core/components/dashboard-layout/DashboardLayoutBasic.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/material/Box'; | ||
import Typography from '@mui/material/Typography'; | ||
import DashboardIcon from '@mui/icons-material/Dashboard'; | ||
import ShoppingCartIcon from '@mui/icons-material/ShoppingCart'; | ||
import BarChartIcon from '@mui/icons-material/BarChart'; | ||
import DescriptionIcon from '@mui/icons-material/Description'; | ||
import LayersIcon from '@mui/icons-material/Layers'; | ||
import { AppProvider } from '@toolpad/core/AppProvider'; | ||
import { DashboardLayout } from '@toolpad/core/DashboardLayout'; | ||
import type { Navigation } from '@toolpad/core'; | ||
|
||
const NAVIGATION: Navigation = [ | ||
{ | ||
kind: 'header', | ||
title: 'Main items', | ||
}, | ||
{ | ||
title: 'Dashboard', | ||
icon: <DashboardIcon />, | ||
}, | ||
{ | ||
title: 'Orders', | ||
icon: <ShoppingCartIcon />, | ||
}, | ||
{ | ||
kind: 'divider', | ||
}, | ||
{ | ||
kind: 'header', | ||
title: 'Analytics', | ||
}, | ||
{ | ||
title: 'Reports', | ||
icon: <BarChartIcon />, | ||
children: [ | ||
{ | ||
title: 'Sales', | ||
icon: <DescriptionIcon />, | ||
}, | ||
{ | ||
title: 'Traffic', | ||
icon: <DescriptionIcon />, | ||
}, | ||
], | ||
}, | ||
{ | ||
title: 'Integrations', | ||
icon: <LayersIcon />, | ||
}, | ||
]; | ||
|
||
export default function DashboardLayoutBasic() { | ||
return ( | ||
<AppProvider navigation={NAVIGATION}> | ||
<DashboardLayout> | ||
<Box | ||
sx={{ | ||
py: 4, | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
}} | ||
> | ||
<Typography>Dashboard content goes here.</Typography> | ||
</Box> | ||
</DashboardLayout> | ||
</AppProvider> | ||
); | ||
} |
42 changes: 42 additions & 0 deletions
42
docs/data/toolpad/core/components/dashboard-layout/DashboardLayoutBranding.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/material/Box'; | ||
import Typography from '@mui/material/Typography'; | ||
import DashboardIcon from '@mui/icons-material/Dashboard'; | ||
import ShoppingCartIcon from '@mui/icons-material/ShoppingCart'; | ||
import { AppProvider } from '@toolpad/core/AppProvider'; | ||
import { DashboardLayout } from '@toolpad/core/DashboardLayout'; | ||
|
||
const NAVIGATION = [ | ||
{ | ||
title: 'Dashboard', | ||
icon: <DashboardIcon />, | ||
}, | ||
{ | ||
title: 'Orders', | ||
icon: <ShoppingCartIcon />, | ||
}, | ||
]; | ||
|
||
const BRANDING = { | ||
logo: <img src="https://mui.com/static/logo.png" alt="MUI logo" />, | ||
title: 'MUI', | ||
}; | ||
|
||
export default function DashboardLayoutBranding() { | ||
return ( | ||
<AppProvider navigation={NAVIGATION} branding={BRANDING}> | ||
<DashboardLayout> | ||
<Box | ||
sx={{ | ||
py: 4, | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
}} | ||
> | ||
<Typography>Dashboard content goes here.</Typography> | ||
</Box> | ||
</DashboardLayout> | ||
</AppProvider> | ||
); | ||
} |
43 changes: 43 additions & 0 deletions
43
docs/data/toolpad/core/components/dashboard-layout/DashboardLayoutBranding.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/material/Box'; | ||
import Typography from '@mui/material/Typography'; | ||
import DashboardIcon from '@mui/icons-material/Dashboard'; | ||
import ShoppingCartIcon from '@mui/icons-material/ShoppingCart'; | ||
import { AppProvider } from '@toolpad/core/AppProvider'; | ||
import { DashboardLayout } from '@toolpad/core/DashboardLayout'; | ||
import type { Navigation, Branding } from '@toolpad/core'; | ||
|
||
const NAVIGATION: Navigation = [ | ||
{ | ||
title: 'Dashboard', | ||
icon: <DashboardIcon />, | ||
}, | ||
{ | ||
title: 'Orders', | ||
icon: <ShoppingCartIcon />, | ||
}, | ||
]; | ||
|
||
const BRANDING: Branding = { | ||
logo: <img src="https://mui.com/static/logo.png" alt="MUI logo" />, | ||
title: 'MUI', | ||
}; | ||
|
||
export default function DashboardLayoutBranding() { | ||
return ( | ||
<AppProvider navigation={NAVIGATION} branding={BRANDING}> | ||
<DashboardLayout> | ||
<Box | ||
sx={{ | ||
py: 4, | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
}} | ||
> | ||
<Typography>Dashboard content goes here.</Typography> | ||
</Box> | ||
</DashboardLayout> | ||
</AppProvider> | ||
); | ||
} |
109 changes: 109 additions & 0 deletions
109
docs/data/toolpad/core/components/dashboard-layout/DashboardLayoutNavigation.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/material/Box'; | ||
import Typography from '@mui/material/Typography'; | ||
import DescriptionIcon from '@mui/icons-material/Description'; | ||
import FolderIcon from '@mui/icons-material/Folder'; | ||
import { AppProvider } from '@toolpad/core/AppProvider'; | ||
import { DashboardLayout } from '@toolpad/core/DashboardLayout'; | ||
|
||
const NAVIGATION = [ | ||
{ | ||
title: 'Item 1', | ||
icon: <DescriptionIcon />, | ||
}, | ||
{ | ||
title: 'Item 2', | ||
icon: <DescriptionIcon />, | ||
}, | ||
{ | ||
title: 'Folder 1', | ||
icon: <FolderIcon />, | ||
children: [ | ||
{ | ||
title: 'Item A1', | ||
icon: <DescriptionIcon />, | ||
}, | ||
{ | ||
title: 'Item A2', | ||
icon: <DescriptionIcon />, | ||
}, | ||
{ | ||
title: 'Folder A1', | ||
icon: <FolderIcon />, | ||
children: [ | ||
{ | ||
title: 'Item B1', | ||
icon: <DescriptionIcon />, | ||
}, | ||
{ | ||
title: 'Item B2', | ||
icon: <DescriptionIcon />, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
{ kind: 'divider' }, | ||
{ | ||
kind: 'header', | ||
title: 'Header 1', | ||
}, | ||
{ | ||
title: 'Item A', | ||
icon: <DescriptionIcon />, | ||
}, | ||
{ | ||
kind: 'header', | ||
title: 'Header 2', | ||
}, | ||
{ | ||
title: 'Item B', | ||
icon: <DescriptionIcon />, | ||
}, | ||
{ | ||
title: 'Folder 2', | ||
icon: <FolderIcon />, | ||
children: [ | ||
{ | ||
kind: 'header', | ||
title: 'Header A1', | ||
}, | ||
{ | ||
title: 'Item C1', | ||
icon: <DescriptionIcon />, | ||
}, | ||
{ | ||
title: 'Item C2', | ||
icon: <DescriptionIcon />, | ||
}, | ||
{ kind: 'divider' }, | ||
{ | ||
kind: 'header', | ||
title: 'Header A2', | ||
}, | ||
{ | ||
title: 'Item C3', | ||
icon: <DescriptionIcon />, | ||
}, | ||
], | ||
}, | ||
]; | ||
|
||
export default function DashboardLayoutNavigation() { | ||
return ( | ||
<AppProvider navigation={NAVIGATION}> | ||
<DashboardLayout> | ||
<Box | ||
sx={{ | ||
py: 4, | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
}} | ||
> | ||
<Typography>Dashboard content goes here.</Typography> | ||
</Box> | ||
</DashboardLayout> | ||
</AppProvider> | ||
); | ||
} |
Oops, something went wrong.