daun/statamic-icon-button-fieldtypes
Composer 安装命令:
composer require daun/statamic-icon-button-fieldtypes
包简介
Icon-only button fieldtypes for Statamic
关键字:
README 文档
README
Icon-only button fieldtypes for compact toggles and switches.
Installation
Install the addon via Composer:
composer require daun/statamic-icon-button-fieldtypes
Fieldtypes
The addon ships with three fieldtypes, each extending a native Statamic fieldtype:
- Single-choice Icon Group extends the native Button Group
- Multi-Choice Icon Toggles extends the Checkboxes fieldtype
- Boolean Icon Toggle extends the Toggle fieldtype
Icon Group
The Icon Group fieldtype extends the native Button Group fieldtype and allows selecting a single option from a predefined set of options.
align: display: Align - type: button_group + type: icon_group options: - value: Left key: left + icon: align-start-vertical - value: Right key: right + icon: align-end-vertical
Icon Toggles
The Icon Toggles fieldtype extends the native Checkboxes fieldtype and allows selecting one or more options from a predefined set of options.
playback: display: Playback options - type: checkboxes + type: icon_toggles options: - value: sound key: sound + icon: volume - value: Loop key: loop + icon: repeat - value: Captions key: captions + icon: captions
Icon Toggle
The Icon Toggle fieldtype extends the native Toggle fieldtype and allows switching a single value on or off.
featured: display: Featured - type: toggle + type: icon_toggle + button_icon: star
Note that the option here is called button_icon because icon key is a reserved key by Statamic.
Custom Icon Sets
Icons are pulled from the built-in icon set. To use icons from a different set, register a custom icon set and change the set option of each field to the desired set.
Example: Lucide
Install and use the Lucide icon set, used in the examples above.
npm install lucide-static
Register the icon set in your service provider.
use Statamic\Facades\Icon; class AppServiceProvider extends ServiceProvider { public function register() { Icon::register('lucide', base_path('node_modules/lucide-static/icons')); } }
Switch the field to use the custom icon set.
featured:
display: Featured
type: icon_toggle
button_icon: star
+ set: lucide
Example: Local SVGs
You can also use local SVG icons in your resources folder.
Icon::register('payments', resource_path('icons/payments'));
License
daun/statamic-icon-button-fieldtypes 适用场景与选型建议
daun/statamic-icon-button-fieldtypes 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 172 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 11 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「icon」 「button」 「fieldtype」 「statamic」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 daun/statamic-icon-button-fieldtypes 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 daun/statamic-icon-button-fieldtypes 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 daun/statamic-icon-button-fieldtypes 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
One of its kind; unlike anything else
PHP Library to get the apple-touch-icons and favicon from a website.
Let users choose from predefined widths
A field type to manage relationships from both sides.
A field type to manage relationships from both sides.
A fieldtype that parses Twig when an element is saved and saves the result as plain text.
统计信息
- 总下载量: 172
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-11-17