hungnm28/livewire-form
Reusable Blade UI components for Laravel and Livewire apps, including form inputs, buttons, modals, asides, theme switching, and Tailwind/Alpine-powered interactions. Config, views, and assets are publishable for easy integration.
Architecture fit. The package is a view-layer veneer, not a form framework. It ships anonymous Blade components (no backing PHP classes) registered under the lf:: prefix via an auto-discovered service provider. It touches nothing in the domain layer — no routes, migrations, models, middleware, or validation rules. That gives a TPM a genuinely small blast radius: components can be adopted one template at a time and removed by deleting template markup, with no data migration and no contract change.
Two consequences matter for planning:
Integration feasibility. Four hard prerequisites gate everything: PHP 8.3+, Laravel 10–13, Livewire 3/4, and Tailwind in the host. Each is binary — partial compliance is not a degraded experience, it is a non-working install. Beyond those, three soft prerequisites each carry their own owner and effort:
| Prerequisite | Owner | Effort | Failure if missed |
|---|---|---|---|
Tailwind content path includes vendor/hungnm28/livewire-form/resources/views/** |
Backend/platform | Hours, but build-pipeline-dependent | Classes silently purged; components render unstyled in prod only |
primary-* palette defined in host theme |
Design/frontend | Hours (mapping) to days (if brand palette must be reconciled) | Unstyled/contrast-broken UI; default theme is orange |
| Alpine available and not overridden by host asset pipeline | Frontend | Hours | Modals, asides, theme cycling, fullscreen all dead |
| Tabler Icons webfont (CDN by default) | Frontend/security | Hours | Icons missing; use_cdn_icons: false required if CSP or offline |
A reasonable estimate for a spike is 3–5 engineer-days; a production pilot on 2–3 templates is 1–2 weeks; broad rollout across an admin surface is 4–6 weeks, dominated by design-token reconciliation rather than component work.
Technical risk. The dominant risk is not technical — it is supply-chain and maintenance provenance:
form.toogle, theme.toogle) kept for backwards compatibility. That is a reasonable maintainer decision, but it is evidence that the component prop contract has drifted without versioning — expect unannounced prop semantics changes.content path points into vendor/. In CI pipelines where vendor/ is installed after the asset build, or where vendor/ is pruned in the production image, CSS generation breaks in a way that only reproduces in one environment.Key questions. These should be answered before a build-vs-adopt decision, not after:
vendor:publish? If the answer is "we customize the published copies," we have effectively forked and the dependency's upgrade path is closed.primary-* utilities, and does the default orange theme conflict with brand tokens?use_cdn_icons: false) rather than depend on a CDN at runtime?@error state and wire:model blur/debounce attributes compatibly with our validation approach? Verify by spike, not by README.Stack fit. Strong fit for a greenfield or recently modernized Laravel + Livewire + Tailwind application with an admin/CRUD/settings surface. Poor fit for legacy apps below Laravel 10, non-Tailwind stacks (Bootstrap, Bulma), Inertia/Vue/React front ends, or anywhere forms are highly dynamic (drag-and-drop builders, multi-step wizards with heavy client logic). It is also a poor fit if the org has standardized on a Tailwind design system (DaisyUI, Flowbite, or an internal library) — the marginal value drops and the vocabulary conflict rises.
Migration path. Three adoption modes, and the TPM should choose one explicitly before work starts:
vendor). Lowest effort, no customization, but the Tailwind content path must reach into vendor/ and the design tokens must match exactly. Recommended only for pilots and internal tools.Recommended sequence: prerequisite audit → spike on one non-critical template → pilot on 2–3 templates → gate review → expand or abandon.
Compatibility. Livewire 3/4 is claimed and the components are Livewire-native in the sense that wire:model passes through; modal open/close is driven by a wire:model property, which is the one place where the package imposes a (minor) state-shape convention on the host component. Alpine is the sharpest compatibility edge: any host that overrides Livewire's bundled Alpine, or loads a second Alpine instance, will break every interactive component simultaneously. Tailwind requires the content-path edit but no other change. Laravel's validation system is assumed, not integrated — error display behavior must be verified in the spike.
Sequencing. Phase 1: dependency and CSP audit plus a one-template spike behind a feature flag, with a written go/no-go on prerequisites. Phase 2: pilot 2–3 templates (settings, an admin CRUD index) and measure actual time saved against a control template built with existing components — this is the only credible input to a buy-vs-build case. Phase 3: design-token reconciliation (primary-*, orange default) before any customer-facing surface. Phase 4: expand to remaining admin surfaces, with a documented internal owner and a pinned version.
Maintenance. The real cost is not the initial install, it is the steady state. If views are published, every upstream release requires a three-way diff between upstream, our published copies, and our local edits — with no changelog to tell us what changed or why. Budget roughly half a day per upgrade cycle, or accept version pinning plus a standing "rebase vs. fork" decision each quarter. Because release notes are empty, upgrading is a regression-testing exercise, so the pilot surface should retain visual smoke tests after rollout. Assign a named owner from day one; unowned published views rot quickly.
Support. MIT, single maintainer, no commercial backing, no dependents, no visible issue history. There is no vendor escalation path. The practical support model is: internal engineers read the Blade source (which is a genuine advantage of anonymous components — the implementation is the documentation) and patch locally. Any defect blocking a release ships as a local patch, which means we should assume a small ongoing patch budget and keep the fork point shallow (few local edits) to preserve the option to re-sync.
Scaling. Three axes. Build-time: vendored Tailwind scanning means CSS output depends on a vendor/ path existing at asset-build time — verify in a clean CI run, not locally. Runtime: components are static Blade with Alpine handlers; per-request cost is negligible relative to Livewire's own payloads, but there are no documented optimizations for very large tables or long forms — treat table components as presentation-only and keep pagination server-side. Team: the win scales with the number of contributors and templates; the risk scales with the number of places a stale published view can drift. Above ~3 engineers touching UI, document the component inventory and a "prefer lf:: unless…" rule, or the codebase will mix vocabularies.
Failure modes. The following should be in the risk register with owners:
| Failure | Likelihood | Detection | Mitigation |
|---|---|---|---|
| Tailwind classes purged in prod (vendor path missing at build) | Medium | Visual diff post-deploy; unstyled layout | Add an integration check on the built CSS; keep path in a shared preset |
| Alpine conflict kills all interactive components | Medium | Manual QA only — fails silently | Pin to Livewire's Alpine; add a Playwright/Cypress smoke test on modal open |
primary-* undefined → broken contrast/branding |
Medium-High | Visual QA | Map palette before pilot; snapshot-test the theme |
| CDN icon fetch blocked by CSP or offline | Medium | Icons disappear, layout shifts | Set use_cdn_icons: false, self-host webfont |
| Silent prop typo (no class, no type) | High | Only visual QA catches it | Component usage lint/conventions; limit to a curated subset |
| Upstream abandonment or breaking release | Medium | No changelog, no signal | Pin version; shallow fork; documented exit |
| Unverified release provenance / future-dated tags | Low-Medium | Manual repo audit | Confirm commit history before ADR sign-off |
Ramp-up. Low for engineers already fluent in Blade + Tailwind — a day to productive, a week to fluent across the ~20 component families. The real ramp-up cost is on the design side: reconciling primary-* and the orange default with brand tokens, and deciding whether the package's visual language becomes the house style. Docs are README-only: no component reference site, no examples of validation error rendering, no accessibility guidance. Plan for one engineer to produce an internal cheat sheet and a curated allowlist of components, otherwise adoption will be uneven and the typo-era aliases will leak in.
Exit strategy. This is the package's strongest operational property: lock-in is very low. Published views plus assets can be copied into the app and the composer requirement dropped in roughly a day, leaving only markup to clean up incrementally. That asymmetry — cheap to try, cheap to leave — is the argument for a timeboxed pilot and against a multi-quarter strategic commitment. Treat it as a scaffolding dependency, not a platform.
How can I help you explore Laravel packages today?