The Dashboard application is a grid-based layout panel where you can place your widgets, in a similiar way as one can organize window applications in a desktop.
The default Dashboard renders a default panel with 3 widgets: a notes widget, a smiley widget and a cat midget.
Click on the icon to enter edit mode. Here you can resize the widgets, delete them, or add new from a given list of default widgets.
There is a mandatory property, id
, which is used to namespace the localStorage item when saving custom configurations.
Dra her for Ć„ flytte widgeten
Er du sikker pƄ at du vil slett dette widget?
Du kan legg til andre senere, men alle innstillinger vil gƄ tapt
Today's mood
š
Dra her for Ć„ flytte widgeten
Er du sikker pƄ at du vil slett dette widget?
Du kan legg til andre senere, men alle innstillinger vil gƄ tapt
Dra her for Ć„ flytte widgeten
Er du sikker pƄ at du vil slett dette widget?
Du kan legg til andre senere, men alle innstillinger vil gƄ tapt
<Dashboard id='eessi-pensjon-ui-demo-1'/>
This custom dashboard illustrates how the dashboard layout object looks like:
sm
, md
and lg
(they can be changed in the Dashboard configuration object)i
, the widget ID (matched in the widget configuration object)x
, the horizontal positiony
, the vertical positionw
, the widget widthh
, the widget height (conditioned to widget resize)minW
, the minimum widget widthmaxW
, the maximum widget widthminH
, the minimum widget heightmaxH
, the maximum widget heightDra her for Ć„ flytte widgeten
Er du sikker pƄ at du vil slett dette widget?
Du kan legg til andre senere, men alle innstillinger vil gƄ tapt
<Dashboard
id='eessi-pensjon-ui-demo'
defaultLayout={{
'Side 1': {
lg: [
{ i: 'w-1-note', x: 0, y: 0, w: 4, h: 5, minW: 4, maxW: 6, minH: 5, maxH: 999 }
],
md: [
{ i: 'w-1-note', x: 0, y: 0, w: 2, h: 6, minW: 2, maxW: 3, minH: 1, maxH: 999 }
],
sm: [
{ i: 'w-1-note', x: 0, y: 0, w: 1, h: 1, minW: 1, maxW: 1, minH: 1, maxH: 999 }
]
},
'Side 2': {
lg: [
{ i: 'w-2-smiley', x: 0, y: 0, w: 4, h: 5, minW: 4, maxW: 6, minH: 5, maxH: 999 }
],
md: [
{ i: 'w-2-smiley', x: 0, y: 0, w: 2, h: 6, minW: 2, maxW: 3, minH: 1, maxH: 999 }
],
sm: [
{ i: 'w-2-smiley', x: 0, y: 0, w: 1, h: 1, minW: 1, maxW: 1, minH: 1, maxH: 999 }
]
},
'Side 3': {
lg: [
{ i: 'w-3-cat', x: 0, y: 0, w: 4, h: 5, minW: 4, maxW: 6, minH: 5, maxH: 999 }
],
md: [
{ i: 'w-3-cat', x: 0, y: 0, w: 2, h: 6, minW: 2, maxW: 3, minH: 1, maxH: 999 }
],
sm: [
{ i: 'w-3-cat', x: 0, y: 0, w: 1, h: 1, minW: 1, maxW: 1, minH: 1, maxH: 999 }
]
}}
defaultWidgets={[{
i: 'w-1-note',
type: 'note',
title: 'Note widget',
visible: true,
options: {
backgroundColor: 'yellow',
content: '<ul><li>Eggs</li><li>Milk</li><li>Bread</li></ul>'
}
}, {
i: 'w-2-smiley',
type: 'smiley',
title: 'Smiley widget',
visible: true,
options: {
mood: 'š'
}
}, {
i: 'w-3-cat',
type: 'cat',
title: 'Cat midget',
visible: true,
options: {}
}]} defaultConfig={{
cols: { lg: 12, md: 3, sm: 1 },
breakpoints: { lg: 900, md: 600, sm: 0 },
margin: [10, 10],
containerPadding: [10, 10],
rowHeight: 30,
defaultTabIndex: 0,
version: 1
}} defaultTabIndex={0}
allowedWidgets={['cat', 'smiley', 'note']}
/>
import Dashboard from 'nav-dashboard'
Property | Type | Required | Description | Default |
---|---|---|---|---|
afterLayoutChange | function | false | Callback function triggered everytime the dashboard layout changes. | - |
allowedWidgets | list | false | List of allowed Dashboard widgets. You will be able to only add those widgets to the dashboard, and you will only be able to see these widget types. By default, you are allowed to see/add all types of widgets. | - |
className | string | false | className prop | - |
configurable | boolean | false | Boolean toggle if we want a configurable dashboard, that is, to see dashboard control panel | true |
defaultConfig | list | false | Dashboard configuration object that overrides the default configuration. Useful for margin/padding/styling/breakpoint set | - |
defaultLayout | object | false | Dashboard layout object that overrides the default layout. | - |
defaultTaIndex | number | false | Active dashboard tab index, if there is more than one dashboard in the dashboard layout. | - |
defaultWidgets | list | false | Dashboard widgets configuration that overrides the default widgets. | - |
extraWidgets | object | false | Append your custom Widgets to the dashboard | - |
id | string | true | Dashboard ID used to namespace the localStorage items for future use | - |
labels | object | true | Optional label object used to override default labels. | - |