定制 daun/statamic-icon-button-fieldtypes 二次开发

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

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

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.

Example icon button fields

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.

Example icon group fields

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.

Example icon toggles field

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.

Example icon toggles field

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

MIT

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 我们能提供哪些服务?
定制开发 / 二次开发

基于 daun/statamic-icon-button-fieldtypes 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

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