PHPackages                             almacareer/twigx-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. almacareer/twigx-bundle

ActiveSymfony-bundle[Templating &amp; Views](/categories/templating)

almacareer/twigx-bundle
=======================

This is Symfony bundle which extends the twig implementation by an JSX like syntax.

5.0.1(6mo ago)115.8k↓61.8%[2 issues](https://github.com/alma-oss/twigx-bundle/issues)[9 PRs](https://github.com/alma-oss/twigx-bundle/pulls)MITPHPPHP ^8.1CI passing

Since Jul 22Pushed 1w ago6 watchersCompare

[ Source](https://github.com/alma-oss/twigx-bundle)[ Packagist](https://packagist.org/packages/almacareer/twigx-bundle)[ RSS](/packages/almacareer-twigx-bundle/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (15)Versions (22)Used By (0)

TwigX Bundle
============

[](#twigx-bundle)

[![Latest Stable Version](https://camo.githubusercontent.com/8c1e8caf3e9d5249ed6a04986621b8f006552673f31059a9380f6df70a1a15cd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c6d616361726565722f74776967782d62756e646c652e737667)](https://packagist.org/packages/almacareer/twigx-bundle)[![Coverage Status](https://camo.githubusercontent.com/b2643271ebec3727721f1d58c333a9a7fe60394e3ba886bb3b4f052376f4d0a7/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6c6d632d65752f74776967782d62756e646c652f62616467652e7376673f6272616e63683d6d61696e)](https://coveralls.io/github/lmc-eu/twigx-bundle?branch=main)

Symfony bundle extending Twig template engine with [JSX](https://reactjs.org/docs/introducing-jsx.html)-like markup.

Requirements
------------

[](#requirements)

- PHP ^8.1
- Symfony ^5.4 || ^6.4 || ^7.2
- Twig ^3

Changelog
---------

[](#changelog)

See [CHANGELOG](./CHANGELOG.md)

How to install
--------------

[](#how-to-install)

### Step 1

[](#step-1)

Download using *composer*

Install package

```
composer require almacareer/twigx-bundle
```

### Step 2

[](#step-2)

Add `TwigXBundle` into bundles (under `all` bundles). If you use Symfony flex, it will be configured automatically.

**bundles.php**

```
    return [
        ...,
        AlmaCareer\TwigXBundle\TwigXBundle::class => ['all' => true],
    ];
```

### Step 3 (optional)

[](#step-3-optional)

If you want to change the default settings, create a config

**config/packages/twigx.yml**

```
    # all parameters are optional
    twigx:
        # define one or more paths to expand or overload components (uses glob patterns)
        paths:
            - "%kernel.project_dir%/templates/components"
        paths_alias: 'jobs-ui' # alias for twig paths above (default is 'spirit')
```

Usage
-----

[](#usage)

Now you can use Twig components with HTML-like syntax in your Symfony project. You only need to remember that, unlike in HTML, component tags must always start with a capital letter:

```
Some other content
  ...

```

You can pass attributes like this:

```

    Submit

```

or pure original implementation

```
{% embed "@spirit/componentName.twig" with { props: {
    attr: 'value'
}} %}
    {% block content %}
        Some other content
    {% endblock %}
{% endembed %}
```

### Allowed parenthesis

[](#allowed-parenthesis)

You can pass variables to props using two syntaxes. JSX-like syntax uses single `{...}` parentheses or Twig-like syntax that uses `{{...}}` parentheses. In both cases, there can be a whitespace around the value that is used. See the examples below.

JSX-like syntax example:

```

```

Twig like syntax example:

```

```

if you want to extend these components, an example guide is [here](./docs/extendComponents.md). if you want to contribute, read guide [here](./docs/contribution.md).

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance81

Actively maintained with recent releases

Popularity29

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~104 days

Recently: every ~60 days

Total

12

Last Release

198d ago

Major Versions

2.1.0 → 3.0.02022-09-29

3.3.0 → 4.0.02025-01-09

4.0.0 → 5.0.02025-05-27

PHP version history (3 changes)2.0.0PHP ^7.4

3.0.0PHP ^7.4 || ^8.1

4.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/6522aab4a6db747059981dba9e8dbc375b9f41b61006162fad60d58629a35d3b?d=identicon)[jindrichpech](/maintainers/jindrichpech)

![](https://www.gravatar.com/avatar/33097e4a9d0e5dd13b5dd7dd01ba89e7a0bbf2b7be8fed2df24426f4175593e4?d=identicon)[literat](/maintainers/literat)

---

Top Contributors

[![janicekt](https://avatars.githubusercontent.com/u/25146453?v=4)](https://github.com/janicekt "janicekt (73 commits)")[![literat](https://avatars.githubusercontent.com/u/2481010?v=4)](https://github.com/literat "literat (73 commits)")[![crishpeen](https://avatars.githubusercontent.com/u/7041807?v=4)](https://github.com/crishpeen "crishpeen (16 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (7 commits)")[![OndraM](https://avatars.githubusercontent.com/u/793041?v=4)](https://github.com/OndraM "OndraM (3 commits)")[![tomasjanicek](https://avatars.githubusercontent.com/u/137899478?v=4)](https://github.com/tomasjanicek "tomasjanicek (2 commits)")

---

Tags

design-systemjsxsymfonysymfony-bundlesyntaxtwig

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/almacareer-twigx-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/almacareer-twigx-bundle/health.svg)](https://phpackages.com/packages/almacareer-twigx-bundle)
```

###  Alternatives

[oro/twig-inspector

Oro Twig Inspector adds the possibility to find twig templates and blocks used for rendering HTML pages faster during development

46519.8k10](/packages/oro-twig-inspector)[nucleos/antispam-bundle

This bundle provides some basic features to reduce spam in symfony forms.

52105.0k](/packages/nucleos-antispam-bundle)[symfony2admingenerator/form-extensions-bundle

Add additional form types to symfony2

1331.6k1](/packages/symfony2admingenerator-form-extensions-bundle)[shapecode/twig-template-event-bundle

Possibility to add code in a twig template dynamically

1010.7k](/packages/shapecode-twig-template-event-bundle)[iq2i/storia-bundle

UI Storia bundle

144.5k](/packages/iq2i-storia-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
