From e22713bbb9524eb4995bc0fb420f3f894a4d10fd Mon Sep 17 00:00:00 2001 From: Ryan Chandler Date: Wed, 13 Nov 2024 13:59:47 +0000 Subject: [PATCH] Widgets/StatsOverview/Docs: Add docs for header and description --- packages/widgets/docs/02-stats-overview.md | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/packages/widgets/docs/02-stats-overview.md b/packages/widgets/docs/02-stats-overview.md index 80dd56420e..084da7ab9d 100644 --- a/packages/widgets/docs/02-stats-overview.md +++ b/packages/widgets/docs/02-stats-overview.md @@ -165,3 +165,27 @@ To disable this behavior, you may override the `$isLazy` property on the widget ```php protected static bool $isLazy = false; ``` + +## Adding a header and description + +You may also add a header and description text above the widget by overriding the `$header` and `$description` properties. + +```php +protected ?string $header = 'Analytics'; + +protected ?string $description = 'An overview of some analytics.'; +``` + +If you need to dynamically generated the header or description text, you can instead override the `getHeader()` and `getDescription()` methods. + +```php +protected function getHeader(): ?string +{ + return 'Analytics'; +} + +protected function getDescription(): ?string +{ + return 'An overview of some analytics.'; +} +```