laravel-ux/dark-mode
Add dark mode to Laravel apps with a simple toggle UI and persistent user preference. laravel-ux/dark-mode offers a lightweight, Blade-friendly setup for theme switching, helping you deliver comfortable light and dark experiences without custom JavaScript.
dark-mode-toggled browser event, it can be the foundation for a broader theming roadmap item (light/dark/system, per-user preference, per-tenant branding) instead of a one-off ticket.Consider adoption when:
prefers-color-scheme behaviour — this package covers the persistence path, so if you only ever want OS-default you may be over-buying.darkMode Alpine store, dark-mode-toggled browser event) standardised so analytics, third-party widgets, or chart libraries can react to theme changes.Look elsewhere or wait when:
v0.1.0 — no prior assessment exists, no migration history, no evidence of a stable public API. Expect breaking changes to directive names, store shape, and event names. If theming is load-bearing for a large surface area, pin the version and be prepared to vendor it.system as a third state or per-tenant/per-brand palettes — not mentioned, so assume it is out of scope.For executives: This is a small, focused package that removes a recurring piece of undifferentiated work — implementing dark mode — from every Laravel project we ship. It delivers an accessible toggle, remembered user preference, and a documented integration path, including an AI-assisted setup skill, which shortens time-to-first-screen for new apps. The commercial argument is consolidation, not capability: we could build this ourselves in a few days per project, but we would rebuild it repeatedly and inconsistently, and accessibility regressions would be ours to own. The caveat to state plainly is maturity — this is version 0.1.0, so treat it as an early-adopter dependency: adopt it in one or two lower-risk surfaces first, pin the version, and revisit once it reaches a stable release.
For engineering: The package gives you a @darkModeScripts Blade directive for setting and synchronising the root dark class, a ux.dark-mode::toggle Livewire component with session-persisted state, an Alpine darkMode store with a dark-mode-toggled browser event, and an accessible toggle composed from existing Laravel UX UI and Icons components. That means one integration contract instead of per-project variants, and a clean event surface for anything that needs to re-render on theme change. The trade-offs: it is v0.1.0 with no upgrade history, the persistence is session-scoped rather than database-backed, and it assumes Blade/Alpine/Livewire and the UX UI component set. Integration effort should be low — start with the Blade directive on the base layout, add the Livewire toggle where you already use Livewire, and rely on the Boost skill and the published installation docs to wire it up. Budget an explicit spike to confirm the store and event names are what you want to standardise on before multiple teams depend on them.
How can I help you explore Laravel packages today?