bhazk/icon

Package untuk menampilkan ikon Heroicons dengan Blade Component

v1.0.0 2025-03-06 16:10 UTC

This package is auto-updated.

Last update: 2025-07-06 17:06:56 UTC


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-cap
  • adjustments
  • annotation
  • archive
  • arrow-circle-down
  • arrow-circle-up
  • bell
  • bookmark
  • chart-bar
  • check
  • chevron-down
  • chevron-left
  • chevron-right
  • chevron-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-cap
  • adjustments
  • annotation
  • archive
  • arrow-circle-down
  • arrow-circle-up
  • bell
  • bookmark
  • chart-bar
  • check
  • chevron-down
  • chevron-left
  • chevron-right
  • chevron-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.