// DOCS ICON PICKER 3.x
Outdated

You are reading the documentation for 3.x. The current version is 4.x.

View 4.x docs →

Usage

In schemas

Add the icon picker to any form schema in your filament panel, or to any livewire component that supports filament forms:

use Guava\IconPicker\Forms\Components\IconPicker;

IconPicker::make('icon');

The field stores the full icon name as a string, for example heroicon-o-academic-cap, so the column in your database is a regular string column:

$table->string('icon')->nullable();

In tables

To display the stored icon in your filament tables, use our IconColumn class:

// Make sure this is the correct import, not the filament one
use Guava\IconPicker\Tables\Columns\IconColumn;

$table
    ->columns([
        IconColumn::make('icon'),
    ])
    // ...
;
IMPORTANTFilament has an IconColumn of its own and both are called the same. If your icons don't render, please check that you imported Guava\IconPicker\Tables\Columns\IconColumn.

On the frontend

We store the full icon name in your database, so there is nothing package specific about rendering it. Treat it as you would any other static icon.

Assuming you saved the icon on your $category model under icon:

<x-icon :name="$category->icon" />

More information on rendering icons is in the blade-icons documentation.

guava/filament-icon-picker 709K installs · 163 stars
// COOKIES

A few cookies keep the site working; others remember preferences or count visits. You choose what runs.

Cookie policy