定制 psyao/filament-icon-picker 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

psyao/filament-icon-picker

最新稳定版本:1.0.0

Composer 安装命令:

composer require psyao/filament-icon-picker

包简介

A Filament form field that provides a searchable icon picker backed by Blade UI Icons manifests.

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A Filament form field that provides a searchable icon picker backed by Blade UI Icons.

By default, Filament includes Heroicons out of the box. This package makes it easy to surface additional icon sets (registered with Blade Icons) in a modal picker.

Notes

  • IconPicker extends Filament's ModalTableSelect and customizes selection and preview behavior.
  • Prefer the IconPicker API for configuration and usage — calling ModalTableSelect methods directly may break selection, styling, or the live preview.

Table of contents

Requirements

  • PHP ^8.2
  • Filament 4.x

Features

  • Modal picker with a searchable table of icons
  • Live preview of the selected icon
  • Filter available icon sets
  • Simple integration with Filament forms, tables and infolists

Installation

Install via Composer:

composer require psyao/filament-icon-picker

Usage

In forms

Use the IconPicker field inside your Filament form schema. The field opens a modal table that lets users pick an icon and renders a live preview automatically.

Basic example:

use Psyao\FilamentIconPicker\Forms\IconPicker;

IconPicker::make('icon')

Limit available sets:

IconPicker::make('icon')
    ->sets(['lucide', 'simple-icons'])

Show labels under icons in the picker:

IconPicker::make('icon')
    ->showIconLabels()

In tables

To display the selected icon in a Filament table, use IconColumn:

use Filament\Tables\Columns\IconColumn;

IconColumn::make('icon')
    ->icon(fn ($state) => $state))

In infolists

To display the selected icon in an infolist, use IconEntry:

use Filament\Infolists\Components\IconEntry;

IconEntry::make('status')
    ->icon(fn ($state) => $state))

In Blade views

Render the selected icon in Blade (depending on your Blade Icons helper):

@svg($icon, ['class' => 'h-5 w-5'])

{{ svg($icon, ['class' => 'h-5 w-5']) }}

Testing

Run the test suite with:

composer test

Changelog

See CHANGELOG for recent changes.

Contributing

See CONTRIBUTING for contribution guidelines.

Security Vulnerabilities

Please review our security policy for reporting vulnerabilities.

Credits

License

The MIT License (MIT). See LICENSE.md for details.

统计信息

  • 总下载量: 6
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-29