Download the PHP package ht3aa/only-one-active-toggle without Composer
On this page you can find all versions of the php package ht3aa/only-one-active-toggle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ht3aa/only-one-active-toggle
More information about ht3aa/only-one-active-toggle
Files in ht3aa/only-one-active-toggle
Package only-one-active-toggle
Short Description A Filament plugin that provides a toggle field that ensures only one toggle is active at a time within a repeater
License MIT
Informations about the package only-one-active-toggle
Only One Active Toggle for Filament
A Filament plugin that provides a toggle field that ensures only one toggle is active at a time within a repeater. This is achieved entirely client-side using Alpine.js, without any server-side requests.
Features
- 🔄 Client-Side Only: Uses Alpine.js for all operations, no server requests needed
- 🎯 Repeater Compatible: Works seamlessly within Filament repeaters
- 🎨 Theme Support: Fully supports both light and dark themes
- 🛠️ Customizable: Supports all standard Filament toggle features
- ⚡ Performance: Lightweight and efficient implementation
Installation
You can install the package via composer:
Usage
This field is designed to be used inside a Filament repeater. When one toggle is activated, all other toggles in the same repeater will be automatically deactivated.
Example
Here's a complete example of how to use the field in a form:
How It Works
The plugin uses Alpine.js to:
- Track the state of all toggles in the repeater
- Automatically deactivate other toggles when one is activated
- Handle all state changes client-side
Requirements
- PHP 8.1+
- Filament 3.x
- Alpine.js (included with Filament)
Support
If you find a bug or have a feature request, please open an issue on GitHub.
License
This package is open-sourced software licensed under the MIT license.