polysource / widgets
Polysource — composable dashboard widgets: counters, top-N lists, sparklines.
Package info
Type:symfony-bundle
pkg:composer/polysource/widgets
v0.1.1
2026-05-10 21:00 UTC
Requires
- php: >=8.1
- polysource/core: ^0.1
- symfony/config: ^5.4 || ^6.0 || ^7.0 || ^8.0
- symfony/dependency-injection: ^5.4 || ^6.0 || ^7.0 || ^8.0
- symfony/http-kernel: ^5.4 || ^6.0 || ^7.0 || ^8.0
- symfony/translation: ^5.4 || ^6.0 || ^7.0 || ^8.0
- symfony/yaml: ^5.4 || ^6.0 || ^7.0 || ^8.0
- twig/twig: ^3.0
Requires (Dev)
- phpunit/phpunit: ^10.5 || ^11.5
This package is auto-updated.
Last update: 2026-05-10 21:01:32 UTC
README
Dashboard widgets for Polysource — KPI counters, top-N lists, sparkline charts.
Part of the Polysource monorepo. MIT-licensed.
What it ships
WidgetInterface(5-method contract) +AbstractWidgetbase.- 3 concrete widgets:
CounterWidget— KPI counter ("12 failed messages", "$45 678 revenue today")ListWidget— top-N list ("5 most recent orders")ChartWidget— sparkline chart (textual fallback in v0.1)
Dashboardimmutable VO +DashboardRegistry(tagged_iteratorpolysource.widgets.dashboard).DashboardExtensionTwig extension (render_widget(),render_dashboard(Dashboard|string),polysource_dashboards()).- 4 Bootstrap 5 templates (dashboard layout + counter/list/chart partials).
See ADR-022. Drag-drop composition deferred to v0.2.
Install
composer require polysource/widgets
Register the bundle:
return [ Polysource\Widgets\PolysourceWidgetsBundle::class => ['all' => true], ];
Extend it
WidgetInterface is 5 methods. Drop in a custom tile in 1 hour:
#[AutoconfigureTag('polysource.widgets.dashboard')] final class IncidentRotatorWidget extends AbstractWidget { public function getName(): string { return 'incident_rotator'; } public function getTemplate(): string { return '@App/widgets/incident_rotator.html.twig'; } public function getData(): array { /* return what your template needs */ } }
See extensibility map.