stefangalescu/statamic-heroicons
Composer 安装命令:
composer require stefangalescu/statamic-heroicons
包简介
Use and easily customize Heroicons in your Statamic templates
README 文档
README
Statamic Heroicons
A package to easily make use of Heroicons in your Statamic sites. This package is a wrapper over blade-ui-kit/blade-heroicons.
For a full list of available icons see the SVG directory from the blade-ui-kit/blade-heroicons repository or preview them at heroicons.com. Heroicons are originally developed by Steve Schoger and Adam Wathan.
If you're looking to use Heroicons v1, please use the v1 version of the package.
Requirements
- PHP 8.1 or higher
- Laravel 9.0 or higher
- Statamic 3.3 or higher
Apart from the requirements above, it is required that you use Statamic's new Runtime Antlers engine. Read more about it and how to enable it in Statamic's official documentation.
Documentation
Installation
First, require statamic-heroicons as a Composer dependency:
composer require stefangalescu/statamic-heroicons
If you need additional options, you can publish the blade-ui-kit/blade-heroicons config. Make sure to also look into the icon caching feature provided by blade-ui-kit/blade-heroicons.
Usage
{{ heroicon:mini:bars-3 }}
{{ heroicon:solid:bars-3 }}
{{ heroicon:outline:bars-3 }}
{{ heroicon:outline:bars-3 class="text-gray-500" }}
{{ heroicon :variant="variant" :icon="icon" }}
Apart from a couple of reserved prop names (as, scope, variant, icon), any prop you pass (e.g. class, style, aria-hidden etc.) to the tag will be added to the root SVG element.
The {{ heroicon }} tag also allows you to pass dynamically binded attributes like you would use in a JavaScript framework like Alpine.js. The only gotcha is that you cannot use the shorthand syntax :class="condition ? 'text-red-500' : 'text-green-500'". You must use the full binding (e.g. x-bind:class, v-bind:class). Example:
{{ heroicon:solid:bars-3 class="w-5 h-5" title="Main menu" }}
{{ heroicon:solid:bars-3 class="w-5 h-5" x-bind:class="condition ? 'text-red-500' : 'text-green-500'" }}
Testing
composer test
Security
Only the latest version of statamic-heroicons will receive security updates if a vulnerability is found.
If you discover a security vulnerability, please report it to Stefan Galescu straight away, via email. Please don't report security issues through GitHub Issues.
Sponsor Stefan
This addon is open-source, meaning anyone can use this addon in their sites for free!
However, maintaining and developing new features for open-source projects can take quite a bit of time. If you're using statamic-heroicons in your production environment, please consider sponsoring me for however you consider to be a fair amount.
stefangalescu/statamic-heroicons 适用场景与选型建议
stefangalescu/statamic-heroicons 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 26.44k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2022 年 06 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 stefangalescu/statamic-heroicons 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 stefangalescu/statamic-heroicons 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 26.44k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-06-20