Available widgets
Filament ships with a few pre-built widgets, as well as the ability to create custom widgets:- Stats widgets display any data, often numeric data, within cards in a row.
- Chart widgets display numeric data in a visual chart.
- Table widgets render data in a table, which supports sorting, searching, filtering, actions, and everything else included within the table builder.
Sorting widgets
Each widget class contains a$sort property that may be used to change its order on the page, relative to other widgets:
Customizing widget width
You may customize the width of a widget using the$columnSpan property. You may use a number between 1 and 12 to indicate how many columns the widget should span, or full to make it occupy the full width of the page:
Responsive widget widths
You may wish to change the widget width based on the responsive breakpoint of the browser. You can do this using an array that contains the number of columns that the widget should occupy at each breakpoint:Customizing the widgets grid
You may change how many grid columns are used to display widgets. Firstly, you must replace the original Dashboard page. Now, in your newapp/Filament/Pages/Dashboard.php file, you may override the getColumns() method to return a number of grid columns to use:
Responsive widgets grid
You may wish to change the number of widget grid columns based on the responsive breakpoint of the browser. You can do this using an array that contains the number of columns that should be used at each breakpoint:Conditionally hiding widgets
You may override the staticcanView() method on widgets to conditionally hide them:
Disabling the default widgets
By default, two widgets are displayed on the dashboard. These widgets can be disabled by updating thewidgets.register property of the configuration file:
Custom widgets
To get started building aBlogPostsOverview widget:
/Widgets directory of the Filament directory, and a view in the /widgets directory of the Filament views directory.
Customizing the dashboard page
If you want to customize the dashboard class, for example to change the number of widget columns, create a new file atapp/Filament/Pages/Dashboard.php:
Dashboard class from the configuration file: