query highlightation
You can enable or disable the highlighting of query matches using the ->highlighter()
method. By default, highlighting is enabled.
use CharrafiMed\GlobalSearchModal\GlobalSearchModalPlugin;
public function panel(Panel $panel): Panel
{
return $panel
...
->plugins([
GlobalSearchModalPlugin::make()
->highlighter(false)
]);
}
Passing Styles
To customize the styles for the highlighted text, you can use the highlightQueryStyles method. This method accepts a string or an array of styles.
Example With Array
use CharrafiMed\GlobalSearchModal\GlobalSearchModalPlugin;
public function panel(Panel $panel): Panel
{
return $panel
...
->plugins([
GlobalSearchModalPlugin::make()
->highlightQueryStyles([
'background-color' => 'yellow',
'font-weight' => 'bold',
])
]);
}
Example With Raw String
use CharrafiMed\GlobalSearchModal\GlobalSearchModalPlugin;
public function panel(Panel $panel): Panel
{
return $panel
...
->plugins([
GlobalSearchModalPlugin::make()
->highlightQueryStyles('background-color: yellow; font-weight: bold;')
]);
}