polysource/widgets

Polysource — composable dashboard widgets: counters, top-N lists, sparklines.

Maintainers

Package info

github.com/polysource/widgets

Homepage

Issues

Type:symfony-bundle

pkg:composer/polysource/widgets

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

v0.1.1 2026-05-10 21:00 UTC

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) + AbstractWidget base.
  • 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)
  • Dashboard immutable VO + DashboardRegistry (tagged_iterator polysource.widgets.dashboard).
  • DashboardExtension Twig 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.

Documentation