Download the PHP package tnt-freskim-veliu/livewire-spotlight-search without Composer
On this page you can find all versions of the php package tnt-freskim-veliu/livewire-spotlight-search. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tnt-freskim-veliu/livewire-spotlight-search
More information about tnt-freskim-veliu/livewire-spotlight-search
Files in tnt-freskim-veliu/livewire-spotlight-search
Package livewire-spotlight-search
Short Description Laravel Livewire spotlight search component
License MIT
Informations about the package livewire-spotlight-search
Livewire Spotlight Search
This package allows you to build a Livewire spotlight search.
Installation
You can install the package via composer:
Requirements
This package uses livewire/livewire (https://laravel-livewire.com/) under the hood.
It also uses TailwindCSS (https://tailwindcss.com/) for base styling, and Alpine JS (https://alpinejs.dev/) for reactivity.
Please make sure you include all of them dependencies before using this component.
Usage
In order to use this component, first you have to include script directive:
@livewireSpotlightSearchScript
and then you can put the component: <livewire:spotlight-search />
after you have to publish config file:
in the config you have to fill searchable key with classes that implements Searchable contract.
Example you can declare the UserSearch class that will handle the search.
Each class must include these methods like in example:
The search modal can be open in many ways:
Cmd+k
Cmd+/ or by dispatching a browser event with name open-spotlight.
Please don't forget to change tailwind.config.js content part, by adding:
./vendor/tnt-freskim-veliu/resources/views/*.blade.php, so tailwind will recognise the classes that we use.
Currently we support the dark mode and light mode by passing:
:on-dark-mode="bool""
TODO
- Add functionality to navigate inside items with keyup and keydown.
- Add command that will create spotlight search classes
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] or use the issue tracker.
Credits
- Freskim Veliu
- All Contributors
License
The MIT License (MIT). Please see License File for more information.