pixelkode/statamic-iconsets
最新稳定版本:v1.0.0
Composer 安装命令:
composer require pixelkode/statamic-iconsets
包简介
A Statamic fieldtype for selecting icons from multiple folders/sets
README 文档
README
A Statamic fieldtype that allows selecting icons from multiple folders/sets with visual preview and grouping.
Features
- Select icons from multiple folders/sets
- Visual icon preview in dropdown
- Folder-based grouping for better organization
- Forward-compatible with Statamic 6's icon set pattern
- Searchable and filterable
Installation
composer require pixelkode/statamic-iconsets php artisan vendor:publish --tag=statamic-iconsets
The publish command copies the compiled JavaScript and CSS assets to your public/vendor/statamic-iconsets/ directory.
Usage
Add the fieldtype to your blueprint:
icon: type: iconset display: Icon instructions: Select an icon from available sets directory: resources/svg/icons # Optional, defaults to resources/svg/icons folders: - statamic - streamline default: statamic/add
Configuration
- directory: Base directory containing icon folders (default:
resources/svg/icons) - folders: Array of folder names to include
- default: Default icon in
folder/filenameformat
Icon Directory Structure
Organize your SVG icons in folders within your configured directory:
resources/svg/icons/
├── statamic/
│ ├── add.svg
│ ├── edit.svg
│ └── delete.svg
├── streamline/
│ ├── arrow-right.svg
│ ├── check.svg
│ └── user.svg
└── custom/
├── logo.svg
└── brand-icon.svg
Each folder becomes a group in the icon picker dropdown.
Template Usage
The fieldtype stores the icon value as folder/filename (e.g., streamline/check). In your Antlers templates, use the {{ icon }} tag to render the raw SVG:
{{ icon }}
This outputs the raw SVG markup, allowing you to style it with CSS:
<span class="w-6 h-6 text-blue-500"> {{ icon }} </span>
Development
For contributors working on this package:
# Install dependencies npm install # Build assets for development npm run dev # Build assets for production npm run build
After making changes to the Vue components, run npm run build to compile the assets.
Requirements
- PHP 8.1+
- Statamic 5.0+
License
MIT License. See LICENSE.md for details.
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-24