bugo/moonshine-heroicons-field
最新稳定版本:2.0
Composer 安装命令:
composer require bugo/moonshine-heroicons-field
包简介
Heroicons selection field for MoonShine
关键字:
README 文档
README
Convenient Heroicons selection field for MoonShine
Support MoonShine versions
| MoonShine | This package |
|---|---|
| 2.0+ | 0.x |
| 3.0+ | 1.x |
| 4.0+ | 2.x |
Installation
composer require bugo/moonshine-heroicons-field
Configuration
You can specify desired default style for icons:
.env:
HEROICONS_STYLE=outline
config/heroicons-field.php:
php artisan vendor:publish --tag=heroicons-field
/* * Possible values: * 's', 'solid' - Solid 24x24, Solid fill * 'o', 'outline' - Outline 24x24, 1.5px stroke * 'm', 'mini' - Mini 20x20, Solid fill * 'c', 'micro' - Micro 16x16, Solid fill */ return [ 'style' => env('HEROICONS_STYLE', 'solid'), ];
Usage
You can use IconSelect field in your resources:
<?php declare(strict_types=1); namespace App\MoonShine\Resources; use Bugo\MoonShine\Heroicons\Fields\IconSelect; use MoonShine\Laravel\Resources\ModelResource; use MoonShine\Contracts\UI\FieldContract; use MoonShine\Contracts\UI\ComponentContract; /** * @extends ModelResource<Custom> */ class CustomResource extends ModelResource { /** * @return list<ComponentContract|FieldContract> */ protected function formFields(): iterable { return [ IconSelect::make('Icon') ->searchable() ->useStyle('mini'), ]; } }
All use cases of Blade Heroicons are also available for you.
Caching
When using icons in Blade templates, be sure to enable Caching.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
统计信息
- 总下载量: 818
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-04-20