zpmlabs/filament-undraw 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

zpmlabs/filament-undraw

最新稳定版本:v5.0.0

Composer 安装命令:

composer require zpmlabs/filament-undraw

包简介

Filament select component for undraw illustrations.

README 文档

README

undraw

Filament Undraw (ZPMLabs)

A Filament select component that lets you search and pick unDraw illustrations with image thumbnails in the dropdown and in the selected value.

PHP 8.2+, Filament Forms 5.x.

Install

composer require zpmlabs/filament-undraw

Filament theme setup

If your Filament panel uses a custom Tailwind theme, add both package paths to your theme file so Tailwind can see the classes used by the package:

@source '../../../../vendor/zpmlabs/filament-undraw/src/**/*';
@source '../../../../vendor/zpmlabs/filament-undraw/resources/views/**/*';

Both are needed for different reasons:

  • src/**/* is required because the field component stores configurable utility classes like w-24 h-24 and w-40 h-40 inside PHP strings.
  • resources/views/**/* is required because the packaged demo page view uses Tailwind classes directly in Blade.

After adding the sources, rebuild your assets:

npm run build

Version support

  • main / v5.x tags: Filament 5
  • v4 branch / v4.x tags: Filament 4

If you want to customize the view:

php artisan vendor:publish --tag=filament-undraw-views
  • This will copy the blade file to resources/views/vendor/filament-undraw/undraw-select.blade.php.

Usage

use ZPMLabs\FilamentUndraw\Forms\Components\UndrawSelect;

UndrawSelect::make('svg_url'),

Since this extends Filament's Select, you can keep using the usual fluent methods alongside the custom thumbnail layout.

Ready-to-use demo page

The package ships with an example Filament page you can mount directly in your panel:

use CommunitySdks\UnlayerFilament\Examples\Pages\UnlayerFilamentDemoPage;
use Filament\Pages\Dashboard;
use ZPMLabs\FilamentUndraw\Examples\Pages\UndrawDemoPage;

$panel->pages([
	Dashboard::class,
	UnlayerFilamentDemoPage::class,
	UndrawDemoPage::class,
]);

Example field presets used on the page:

use ZPMLabs\FilamentUndraw\Forms\Components\UndrawSelect;

UndrawSelect::make('hero_illustration')
	->label('Hero illustration')
	->live();

UndrawSelect::make('compact_illustration')
	->label('Compact illustration')
	->searchResultSize('w-24 h-24')
	->selectedOptionSize('w-24 h-24')
	->limit(12);

Expanding Undraw Usage

In case you want to expand this in some other field or custom component you can check the base php package for undraw.

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固