Pages · Laravilt
Widgets
Stats cards and charts for dashboards and pages.
The laravilt/widgets package provides dashboard building blocks: a grid of stat cards and line, bar and pie charts. You describe a widget in PHP, and the panel renders it with its Vue 3 or React 19 components (charts are drawn with Chart.js). Any widget can refresh itself with polling.
React support requires Laravilt v1.1 or later.
php
The default dashboard also adds a stat card for every resource automatically.
In this section
- Widget Types: Stats Overview, Line Chart, Bar Chart, Pie Chart
- Custom Widgets: generate widget classes and add them to dashboards and pages
Shared methods
Every widget extends Laravilt\Widgets\Widget:
| Method | Description |
|---|---|
make() | Create an instance (static) |
heading(string $heading) | Title |
description(string $description) | Text under the title |
icon(string $icon) | Icon name |
color(string $color) | primary, secondary, success, danger, warning or info |
polling(?int $interval = 10) | Refresh every $interval seconds |
extraAttributes(string $attributes) | Extra HTML attributes for the wrapper |
Installation
Widgets ship with Laravilt. To republish the package files:
bash
Related
- Panel
- Live demo dashboard (log in with
[email protected]/password)