Icon Picker Select Field with Live Icon Display

Filament 4

This project illustrates creating a customized select field that displays HTML-formatted results with integrated search functionality.

pLliKG15zkkFxKu88NiU7nhNdAvcJ5-metaRmlsYW1lbnRFeGFtcGxlcyBUaHVtYkJhc2UgKDE4KS5wbmc=-

Get the Source Code:

How it works

In the Model, the database column is casted to the enum.

use Filament\Support\Icons\Heroicon;
use Illuminate\Database\Eloquent\Model;
 
class Category extends Model
{
protected $fillable = [
'name',
'icon',
];
 
protected function casts(): array
{
return [
'icon' => Heroicon::class,
];
}
}

The project uses Filament's built-in Heroicon enum class from Filament\Support\Icons\Heroicon, which provides access to all Heroicons without needing to generate a custom enum.

We have a select field with enabled HTML support using the allowHtml() method and search functionality using the searchable() method.

Options for the select field are returned from the enum class.

The FULL tutorial is available after the purchase: in the Readme file of the official repository you would get invited to.
Get the Source Code: All 113 Premium Examples for $99