kachnitel/components-bundle
Composer 安装命令:
composer require kachnitel/components-bundle
包简介
A Symfony bundle for reusable Twig components
README 文档
README
A Symfony bundle providing reusable Twig and Live Components for common UI patterns.
Installation
composer require kachnitel/components-bundle
Quick Start
Calendar
Display a monthly calendar with custom content for each day:
<twig:K:Components:Calendar year="2024" month="1"> <twig:block name="dayContent"> {{ date }} - Your content here </twig:block> </twig:K:Components:Calendar>
Dialog
Create modal dialogs with a trigger button:
<twig:K:Components:DialogTrigger dialogId="my-dialog" label="Open" /> <twig:K:Components:Dialog id="my-dialog" label="My Dialog"> Dialog content here </twig:K:Components:Dialog>
Timer (Live Component)
Display a running timer that updates every second:
<twig:K:Components:Timer :startTime="timeEntry.startTime" />
LiveEmitTrigger (Live Component)
Emit events to other Live Components:
<twig:K:Components:LiveEmitTrigger target="MyApp:MyComponent" action="save" />
Documentation
See the full documentation for detailed usage and options.
Available Components
| Component | Type | Description |
|---|---|---|
| Calendar | Twig | Monthly calendar grid with customizable day content |
| Dialog | Twig | Native HTML dialog wrapper with Stimulus controller |
| DialogTrigger | Twig | Button to open a Dialog component |
| Timer | Live | Auto-updating duration timer |
| LiveEmitTrigger | Live | Button to emit events to Live Components |
License
MIT
统计信息
- 总下载量: 275
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-23