lmc/spirit-web-twig-bundle
Symfony bundle that integrates the Spirit Web design system with Twig, offering reusable UI components, Twig extensions, and simple configuration so PHP teams can build consistent, accessible interfaces faster. It streamlines component rendering and keeps templates aligned with Spirit's design token...
Read this first: it is not a Laravel package. lmc/spirit-web-twig-bundle is a Symfony bundle — its entry point is a Bundle subclass, a DI Extension, and Twig path registration. It has no ServiceProvider, no config/ publish target, and no Blade directives. In a Blade-first Laravel app it will not boot, and pulling in twigbridge to consume a component library adds a second template engine for marginal gain.
So there are two honest on-ramps:
Path A — you already run Twig in Laravel (twigbridge) or are evaluating a Symfony surface.
composer require lmc/spirit-web-twig-bundle.npm install @lmc-eu/spirit-web. The bundle ships Twig helpers and markup only — the CSS/JS is external and mandatory.Path B — you're Blade-native (the normal Laravel case). Skip the bundle.
npm install @lmc-eu/spirit-web.Where to look first, either way:
vendor/lmc/spirit-web-twig-bundle/templates and src/Twig/ are ground truth. The README is thin and often behind.composer.json for PHP/Twig version constraints before you commit.A sane first task: replace one hardcoded <button class="…"> with either the helper (Path A) or a Blade component (Path B), verify visually, then expand.
Wrap, don't scatter. Whatever form you consume, add your own thin layer on top — Blade components (<x-spirit.button variant="primary">) or a Twig macro/{% embed %} wrapper. Templates then call your component, not the raw bundle signature. If the bundle's API shifts (it will — very low activity), you patch one file.
Form rendering is the highest-leverage integration.
@error blocks. This converts a large surface of generic inputs into consistently styled, Spirit-aligned fields without touching controllers.form_theme blocks to emit Spirit markup. Start with one field type, confirm, then roll out.Compose inside layouts. Use the components within your header/nav/alert/modal layouts. Because Spirit components are custom elements, keep slot content in your template and let the element handle interactivity — don't re-implement open/close or keyboard behavior in Twig/Blade.
Asset pipeline. Install and pin @lmc-eu/spirit-web in package.json, import its CSS/JS in your entrypoint, and let Vite hash and cache-bust it. Do not rely on Symfony AssetMapper/Encore assumptions if you're in Laravel — asset resolution is exactly where bundle assumptions leak.
Version discipline. Pin the spirit-web npm version and record which bundle version you're targeting. These version independently and drift silently: your helpers emit class names that a newer/older CSS package no longer styles, with no error.
Reference-implementation tactic. If your estate has a Symfony/Twig surface, adopt the bundle there first and use its rendered output as a parity oracle for your Blade ports.
artisan vendor:publish, and config discovery you read about in Symfony docs doesn't map. Evaluate the underlying @lmc-eu/spirit-web on its own merits instead.spirit-web are versioned separately. Pin both, and add a visual smoke check per component after any bump.composer require into a throwaway app surfaces Symfony polyfill conflicts and any PHP/Twig constraint surprises before they hit your real tree.How can I help you explore Laravel packages today?