Skip to content
Zonvoir Table LogoZonvoir Table

Icons & Icon Collections

Zonvoir Table supports icons using string-based icon identifiers.

Instead of importing icons into your PHP table classes, pass the icon name as a string and let the frontend adapter render it.

Pass an icon identifier wherever an icon option is supported.

->icon('heroicons:user')

For example:

TableEmptyState::make(
title: 'No users found',
icon: 'heroicons:users',
);

Icons use the following format:

collection:icon

For example:

heroicons:user
heroicons:users
heroicons:plus
lucide:user
lucide:users
lucide:search

The part before : identifies the icon collection, while the part after : identifies the icon.

heroicons:users
│ │
│ └── icon
└── collection

Add an icon to an empty state:

use Zonvoir\ZonvoirTable\TableEmptyState;
public function emptyState(): TableEmptyState
{
return TableEmptyState::make(
title: 'No employees found',
message: 'Create your first employee to get started.',
icon: 'heroicons:users',
);
}

Actions can also display icons:

Action::make('Add employee')
->icon('heroicons:plus')
->url(
(new Url())->route('employees.create')
);

Another action could use a different icon collection:

Action::make('Edit')
->icon('lucide:pencil');

You are not limited to a single icon collection.

Different supported collections can be used throughout the same application:

TableEmptyState::make(
icon: 'heroicons:users',
);
Action::make('Edit')
->icon('lucide:pencil');
Action::make('Delete')
->icon('lucide:trash-2');

The frontend adapter resolves the icon identifier and renders the appropriate icon.

Icon identifiers can be passed anywhere Zonvoir Table exposes an icon option.

For example:

->icon('heroicons:users')

The same string-based format is used consistently across the package, so you don’t need to import frontend icon components into your PHP table definitions.