bhazk/icon
Composer 安装命令:
composer require bhazk/icon
包简介
Package untuk menampilkan ikon Heroicons dengan Blade Component
README 文档
README
Bhazk Icon adalah package Laravel untuk menampilkan ikon dengan Blade Component. Secara default, package ini menggunakan Heroicons, namun Anda dapat menambahkan set ikon kustom sesuai kebutuhan.
📌 Instalasi
Jalankan perintah berikut untuk menginstal package ini:
composer require bhazk/icon
🔧 Konfigurasi
Publikasikan file konfigurasi dengan perintah:
php artisan vendor:publish --tag=bhazk-icon
Setelah itu, file config/bhazk-icon.php akan tersedia untuk dikustomisasi.
Secara default, set ikon yang digunakan adalah heroicons, dan gaya ikon outline. Anda bisa mengubahnya di file konfigurasi:
return [ 'default_set' => 'heroicons', 'default_style' => 'outline', 'default_color' => 'currentColor', 'default_size' => 'w-5 h-5', 'resource_path' => resource_path('icons'), ];
🚀 Penggunaan
Gunakan komponen Blade berikut untuk menampilkan ikon:
<x-bhazk::icon name="academic-cap" />
Opsi Tambahan
<x-bhazk::icon name="academic-cap" style="solid" size="w-6 h-6" color="red-500" />
| Atribut | Deskripsi |
|---|---|
name |
Nama ikon yang akan ditampilkan |
style |
Gaya ikon (outline atau solid) |
size |
Kelas Tailwind untuk ukuran ikon |
color |
Warna ikon (misal: red-500, blue-600, dll.) |
🎨 Menggunakan Set Ikon Kustom
Untuk menggunakan ikon dari set berbeda, Anda bisa meletakkan ikon SVG di folder:
resources/icons/{set}/{style}/
Misalnya, untuk menambahkan ikon custom-icon.svg dengan set myicons dan gaya solid, letakkan file di:
resources/icons/myicons/solid/custom-icon.svg
Lalu gunakan:
<x-bhazk::icon name="custom-icon" set="myicons" style="solid" />
📜 Daftar Ikon Heroicons
Heroicons menyediakan berbagai ikon yang dapat digunakan. Beberapa contohnya:
academic-capadjustmentsannotationarchivearrow-circle-downarrow-circle-upbellbookmarkchart-barcheckchevron-downchevron-leftchevron-rightchevron-up
Daftar lengkap dapat ditemukan di Heroicons Official.
Lisensi
Paket ini bersifat open-source dan dilisensikan di bawah lisensi MIT.
Pemecahan Masalah
Jika Anda mengalami masalah, pastikan Anda telah menyiapkan konfigurasi yang diperlukan dalam berkas konfigurasi bhazk-icon.php. Periksa juga batasan API atau kesalahan dari Google Translate.
Kontribusi
Kontribusi diterima! Silakan buat masalah atau kirimkan permintaan tarik untuk bug atau permintaan fitur apa pun.
Kontak
Untuk pertanyaan atau permintaan apa pun, silakan hubungi Adi Arta Wibawa di surat.buat.adi@gmail.com.
Bhazk Icon is a Laravel package for displaying icons using Blade Components. By default, it uses Heroicons, but you can add custom icon sets as needed.
📌 Installation
Run the following command to install the package:
composer require bhazk/icon
🔧 Configuration
Publish the configuration file with:
php artisan vendor:publish --tag=bhazk-icon
After that, the config/bhazk-icon.php file will be available for customization.
By default, the icon set used is heroicons, and the default style is outline. You can change it in the config file:
return [ 'default_set' => 'heroicons', 'default_style' => 'outline', 'default_color' => 'currentColor', 'default_size' => 'w-5 h-5', 'resource_path' => resource_path('icons'), ];
🚀 Usage
Use the following Blade component to display an icon:
<x-bhazk::icon name="academic-cap" />
Additional Options
<x-bhazk::icon name="academic-cap" style="solid" size="w-6 h-6" color="red-500" />
| Attribute | Description |
|---|---|
name |
The name of the icon to display |
style |
Icon style (outline or solid) |
size |
Tailwind class for icon size |
color |
Icon color (e.g., red-500, blue-600, etc.) |
🎨 Using Custom Icon Sets
To use icons from a different set, place your SVG icons in the following folder:
resources/icons/{set}/{style}/
For example, to add a custom-icon.svg with the myicons set and solid style, place the file in:
resources/icons/myicons/solid/custom-icon.svg
Then use:
<x-bhazk::icon name="custom-icon" set="myicons" style="solid" />
📜 Heroicons Icon List
Heroicons provides various icons that can be used. Some examples:
academic-capadjustmentsannotationarchivearrow-circle-downarrow-circle-upbellbookmarkchart-barcheckchevron-downchevron-leftchevron-rightchevron-up
The full list can be found at Heroicons Official.
License
This package is open-source and licensed under the MIT license.
Troubleshooting
If you encounter any issues, ensure you have the necessary configurations set up in the bhazk-icon.php configuration file. Check for any API limitations or errors from Google Translate as well.
Contributing
Contributions are welcome! Please open an issue or submit a pull request for any bugs or feature requests.
Contact
For any questions or inquiries, please contact Adi Arta Wibawa at surat.buat.adi@gmail.com.
bhazk/icon 适用场景与选型建议
bhazk/icon 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 03 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「component」 「laravel」 「blade」 「Heroicons」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 bhazk/icon 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bhazk/icon 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 bhazk/icon 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
FSi DataSource Component
Priveate for SkeekS CMS
Module for bootstrapping components in the Monolith framework.
qscmf modal button download
Alfabank REST API integration
Crontab
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-06