PHPackages                             awcodes/light-switch - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. awcodes/light-switch

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

awcodes/light-switch
====================

Plugin to add theme switching (light/dark/system) to the auth pages for Filament Panels

v3.0.0(3mo ago)4789.9k—1%82MITPHPPHP ^8.2CI passing

Since Aug 8Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/awcodes/light-switch)[ Packagist](https://packagist.org/packages/awcodes/light-switch)[ Docs](https://github.com/awcodes/light-switch)[ GitHub Sponsors](https://github.com/awcodes)[ RSS](/packages/awcodes-light-switch/feed)WikiDiscussions 3.x Synced 1mo ago

READMEChangelog (9)Dependencies (9)Versions (12)Used By (2)

Light Switch
============

[](#light-switch)

Plugin to add theme switching (light/dark/system) to the auth pages for Filament Panels

[![Latest Version](https://camo.githubusercontent.com/fe0c6e13877858f577a6afa8cd54a7b85399b3af58438f0ad948587cba373177/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6177636f6465732f6c696768742d7377697463682e7376673f7374796c653d666c61742d73717561726526636f6c6f723d626c7565266c6162656c3d52656c65617365)](https://github.com/awcodes/light-switch/releases)[![MIT Licensed](https://camo.githubusercontent.com/a7e65aee57b11d28e4caff8b945729a66be0bb663f7f93bd24c5aa65699f148e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/a63e5dddb7c030657be7275af512a1de3f8536c9f18fb6b2c9667e0592f8f9c1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6177636f6465732f6c696768742d7377697463682e7376673f7374796c653d666c61742d73717561726526636f6c6f723d626c7565266c6162656c3d446f776e6c6f616473)](https://packagist.org/packages/awcodes/light-switch)[![GitHub Repo stars](https://camo.githubusercontent.com/356281cf453c15d63e0f7c150b3770886db326cbe971e15dc6fbd451d20b5028/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6177636f6465732f6c696768742d7377697463683f7374796c653d666c61742d73717561726526636f6c6f723d626c7565266c6162656c3d5374617273)](https://github.com/awcodes/light-switch/stargazers)

Compatibility
-------------

[](#compatibility)

Package VersionFilament Version1.x3.x2.x4.x3.x5.xInstallation
------------

[](#installation)

You can install the package via composer:

```
composer require awcodes/light-switch
```

Important

If you have not set up a custom theme and are using Filament Panels follow the instructions in the [Filament Docs](https://filamentphp.com/docs/4.x/styling/overview#creating-a-custom-theme) first.

After setting up a custom theme add the plugin's views to your theme css file or your app's css file if using the standalone packages.

```
@source '../../../../vendor/awcodes/light-switch/resources/**/*.blade.php';
```

Usage
-----

[](#usage)

```
use Awcodes\LightSwitch\LightSwitchPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            LightSwitchPlugin::make(),
        ]);
}
```

### Position

[](#position)

By default, the switcher will be added to the top right of the auth pages. You can change this by passing one of the `Alignment` enums cases to the `position()` method.

```
use Awcodes\LightSwitch\LightSwitchPlugin;
use Awcodes\LightSwitch\Enums\Alignment;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            LightSwitchPlugin::make()
                ->position(Alignment::BottomCenter),
        ]);
}
```

### Disabling on specific pages

[](#disabling-on-specific-pages)

You can disable the switcher on specific pages by passing an array of route strings to the `on()` method. Anything in this array will get evaluated as should be shown. Otherwise, it will be enabled on all auth pages available to your panel.

When determining if the switcher should be shown the `Str::contains()` method is used to match the route name, so you can pass a partial route string to match multiple pages and not have to pass the complete route name. This is useful if you need to target routes containing a specific panel route, like `admin.auth.email` or `app.auth.email`.

```
use Awcodes\LightSwitch\LightSwitchPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            LightSwitchPlugin::make()
                ->enabledOn([
                    'auth.email',
                    'auth.login',
                    'auth.password',
                    'auth.profile',
                    'auth.register',
                ]),
        ]);
}
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Adam Weston](https://github.com/awcodes)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

56

—

FairBetter than 98% of packages

Maintenance82

Actively maintained with recent releases

Popularity45

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity63

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 ~85 days

Recently: every ~47 days

Total

12

Last Release

77d ago

Major Versions

v1.0.3 → v2.0.0-beta.12025-06-16

1.x-dev → v2.0.02025-08-12

2.x-dev → v3.0.02026-01-19

PHP version history (2 changes)v1.0.0PHP ^8.1

v2.0.0-beta.1PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3596800?v=4)[Adam Weston](/maintainers/awcodes)[@awcodes](https://github.com/awcodes)

---

Top Contributors

[![awcodes](https://avatars.githubusercontent.com/u/3596800?v=4)](https://github.com/awcodes "awcodes (24 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (16 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (8 commits)")[![sakanjo](https://avatars.githubusercontent.com/u/121197517?v=4)](https://github.com/sakanjo "sakanjo (2 commits)")[![aymanalareqi](https://avatars.githubusercontent.com/u/77433449?v=4)](https://github.com/aymanalareqi "aymanalareqi (1 commits)")[![Jacobtims](https://avatars.githubusercontent.com/u/75219092?v=4)](https://github.com/Jacobtims "Jacobtims (1 commits)")

---

Tags

filamentfilament-pluginpluginlaravelfilamentawcodeslight-switch

###  Code Quality

TestsPest

Static AnalysisRector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/awcodes-light-switch/health.svg)

```
[![Health](https://phpackages.com/badges/awcodes-light-switch/health.svg)](https://phpackages.com/packages/awcodes-light-switch)
```

###  Alternatives

[pboivin/filament-peek

Full-screen page preview modal for Filament

253319.6k12](/packages/pboivin-filament-peek)[awcodes/filament-badgeable-column

Filament Tables column to append and prepend badges.

142419.3k3](/packages/awcodes-filament-badgeable-column)[awcodes/filament-table-repeater

A modified version of the Filament Forms Repeater to display it as a table.

262815.1k5](/packages/awcodes-filament-table-repeater)[awcodes/filament-curator

A media picker plugin for FilamentPHP.

434297.7k19](/packages/awcodes-filament-curator)[awcodes/recently

Easily track and access recently viewed records in your filament panels.

4224.3k](/packages/awcodes-recently)[dotswan/filament-map-picker

Easily pick and retrieve geo-coordinates using a map-based interface in your Filament applications.

124139.3k2](/packages/dotswan-filament-map-picker)

PHPackages © 2026

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