Dashboard application

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.

Simple dashboard

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.

Note widget

  • Eggs
  • Milk
  • Bread

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

cat midget

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'/>

Custom dashboard

This custom dashboard illustrates how the dashboard layout object looks like:

Note widget

  • Eggs
  • Milk
  • Bread

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'
  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']}
/>

Component import

import Dashboard from 'nav-dashboard'

React props

PropertyTypeRequiredDescriptionDefault
afterLayoutChangefunctionfalseCallback function triggered everytime the dashboard layout changes.-
allowedWidgetslistfalseList 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.-
classNamestringfalseclassName prop-
configurablebooleanfalseBoolean toggle if we want a configurable dashboard, that is, to see dashboard control paneltrue
defaultConfiglistfalseDashboard configuration object that overrides the default configuration. Useful for margin/padding/styling/breakpoint set-
defaultLayoutobjectfalseDashboard layout object that overrides the default layout.-
defaultTaIndexnumberfalseActive dashboard tab index, if there is more than one dashboard in the dashboard layout.-
defaultWidgetslistfalseDashboard widgets configuration that overrides the default widgets.-
extraWidgetsobjectfalseAppend your custom Widgets to the dashboard-
idstringtrueDashboard ID used to namespace the localStorage items for future use-
labelsobjecttrueOptional label object used to override default labels.-