Dashboard Shaper
Shape your dashboard into life.
Example
Props
đšī¸ standard props
layoutWidth number
Width of the dashboard grid
6layoutHeight number
Height of the dashboard grid
4widgets Widget[]
Widgets to display
availableWidgetCells AvailableWidget[]
Every available widget to choose from
someRowSlotEmpty boolean
True if there is a row that is not fully complete
preview boolean
Puts the dashboard in preview mode
falsecanAdd boolean
Enables add widget button
truelang "it" | "en"
Language of the text
"en"đ¨ style props
--dashboard-shaper-widget-height height
Widget height
200px--dashboard-shaper-gap gap
Gap between widgets
4px--dashboard-shaper-cell-preview-background-color color
Preview widgets background color
rgb(var(--global-color-primary-500), 0.5)--dashboard-shaper-widget-preview-border-radius border-radius
Preview widgets border radius
8px--dashboard-shaper-display-mobile display
Dashboard display on mobile screen
flex--dashboard-shaper-flex-direction-mobile flex-direction
Dashboard flex direction on mobile screen
column--dashboard-shaper-dialog-background-color color
Selection dialog background color
rgb(var(--global-color-background-300))--dashboard-shaper-dialog-header-background-color color
Selection dialog header background color
rgb(var(--global-color-background-400))--dashboard-shaper-add-widget-button-background-color color
Add widget button background color
rgb(var(--global-color-background-300))Slots
widgetCellSnippet
Snippet containing the actual widget
Default content:
{widgetCell.widget.componentName}
Available variables:
| Name | Type | Description |
|---|---|---|
widgetCell | Widget | The widget to display |
removeWidgetCell | ({ id }) => void | Function to call when deleting a widget |
addWidgetButtonSnippet
The button to add widget
Default content:
<button
class="add-button"
onclick={() => handleAddClick({ slot })}
>
<Icon name="mdi-plus" --icon-default-size="1.5rem" />
<div class="description">{lang == 'en' ? 'Add widget' : 'Aggiungi widget'}</div>
</button>
Available variables:
| Name | Type | Description |
|---|---|---|
handleAddClick | ({ slot }) => void | Function to call to add a widget |
slot | Slot | Slot to pass to the handleAddClick function |
widgetSelectionDialogHeaderSnippet
Header of the dialog to select widgets
Default content:
<div class="header">
<Icon name={"mdi-widgets-outline"} --icon-size="30px"/>
<div class="title">{lang == 'en' ? 'Add widget' : 'Aggiungi widget'}</div>
</div>
Events
onaddWidgetCell
Event dispatched when a widget is added
| Attribute | Type | Description |
|---|---|---|
| widgetCell | Widget | The widget added |
onremoveWidgetCell
Event dispatched when a widget is removed
| Attribute | Type | Description |
|---|---|---|
| widgetCell | Widget | The widget removed |