Saltar al contenido principal

Dashboard Widget Development

Create custom dashboard widgets for the Gauzy dashboard.

Overviewโ€‹

Dashboard widgets provide at-a-glance metrics and data visualizations on the main dashboard.

Widget Architectureโ€‹

interface IDashboardWidget {
id: string;
name: string;
component: Type<any>;
defaultWidth: number; // Grid columns (1-12)
defaultHeight: number; // Grid rows
permissions?: string[];
}

Creating a Widgetโ€‹

1. Create the Componentโ€‹

@Component({
selector: "ga-my-widget",
template: `
<nb-card>
<nb-card-header>My Widget</nb-card-header>
<nb-card-body>
<div class="widget-content">
<span class="metric">{{ value }}</span>
<span class="label">Active Tasks</span>
</div>
</nb-card-body>
</nb-card>
`,
})
export class MyWidgetComponent implements OnInit {
value: number;

ngOnInit() {
this.loadData();
}

async loadData() {
this.value = await this.dashboardService.getActiveTaskCount();
}
}

2. Register the Widgetโ€‹

@NgModule({
declarations: [MyWidgetComponent],
providers: [
{
provide: DASHBOARD_WIDGETS,
useValue: {
id: "my-widget",
name: "Active Tasks",
component: MyWidgetComponent,
defaultWidth: 4,
defaultHeight: 2,
},
multi: true,
},
],
})
export class MyWidgetModule {}

Built-in Widgetsโ€‹

WidgetDescriptionDefault Size
Today's LogCurrent day time log4 ร— 2
Active TasksTasks in progress4 ร— 2
Team ActivityTeam member status4 ร— 3
Income/ExpenseFinancial summary6 ร— 3
Project ProgressProject completion6 ร— 3

API Referenceโ€‹