Search by

kachnitel / components-bundle

kachnitel

A Symfony bundle for reusable Twig components

Package info

github.com/kachnitel/FrdComponentsBundle

Type:symfony-bundle

pkg:composer/kachnitel/components-bundle

Statistics

Installs: 329

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 1

dev-main 2026-09-09 08:33 UTC

This package is auto-updated.

Last update: 2026-09-09 08:34:29 UTC


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" />

Toast

Render a toast region that responds to browser events:

<twig:K:Components:Toast />

From a Symfony UX Live Component, dispatch a notification:

$this->dispatchBrowserEvent('toast.show', [
  'message' => 'Please correct the errors below and try again.',
  'type' => 'error',
]);

See the Toast documentation for custom events, duration, and styling.

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
Toast Twig Event-driven notification region
Timer Live Auto-updating duration timer
LiveEmitTrigger Live Button to emit events to Live Components

License

MIT