borjajimnz / text-input-autocomplete
Filamentphp TextInput with Autocomplete feature
Fund package maintenance!
borjajimnz
Installs: 279
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Language:Blade
Requires
- php: ^8.3
- illuminate/contracts: ^10.0||^11.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^9.0.0||^8.22.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
README
This package replaces the native <datalist>
functionality with a custom, non-native autocomplete for the TextInput component in FilamentPHP 3, offering enhanced flexibility and customization options.
Installation
You can install the package via composer:
composer require borjajimnz/text-input-autocomplete
Usage
By default, we will use a non-native datalist. If you want to use the native one, simply add ->datalistNative()
.
Use the Tab key to navigate through the available options in the datalist, or move around using the Up and Down arrow keys.
use Borjajimnz\TextInputAutocomplete\Forms\Components\AutoComplete; AutoComplete::make('favorite') ->datalist(function () { return ['php','laravel', 'livewire','filamentphp', 'tailwindcss']; });
These are all the options available to configure your field, if needed.
use Borjajimnz\TextInputAutocomplete\Forms\Components\AutoComplete; AutoComplete::make('favorite') ->datalistNative(false) ->datalistMinCharsToSearch(0) ->datalistMaxItems(false) ->datalistDisableScroll(false) ->datalistOpenOnClick(true) ->datalist(function () { return ['php','laravel', 'livewire','filamentphp', 'tailwindcss']; });
Or if you want to use the native datalist with a custom ID.
use Borjajimnz\TextInputAutocomplete\Forms\Components\AutoComplete; AutoComplete::make('favorite') ->datalistNativeId('customized.id') ->datalist(function () { return ['php','laravel', 'livewire','filamentphp', 'tailwindcss']; });
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.