Skip to content
Shamar

ListWidget

From the /demo dashboard widget grid.
export class RecentProductsWidget extends ListWidget {
static override heading = 'Recent products'
static override columns() {
return [{ label: 'SKU', attribute: 'sku' }, { label: 'Name', attribute: 'name' }]
}
static override async records(ctx) {
return items.map((i) => ({ ...i, url: '/demo/products/' + i.id }))
}
}

Methods

MethodDescription
static columns()Column definitions.
static records(ctx)Row data with optional url per row.
static limitMax rows (default 5).