定制 stefangalescu/statamic-heroicons 二次开发

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

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

stefangalescu/statamic-heroicons

最新稳定版本:v3.1

Composer 安装命令:

composer require stefangalescu/statamic-heroicons

包简介

Use and easily customize Heroicons in your Statamic templates

README 文档

README

Banner

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.

统计信息

  • 总下载量: 22.89k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固