polysource/widgets
最新稳定版本:v0.1.2
Composer 安装命令:
composer require polysource/widgets
包简介
Polysource — composable dashboard widgets: counters, top-N lists, sparklines.
README 文档
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.
Documentation
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-10