ihahachi / calcite-ui-icons
Calcite UI Icons Blade component for Laravel
Package info
github.com/ihahachi/calcite-ui-icons
Language:Blade
pkg:composer/ihahachi/calcite-ui-icons
Requires
- php: ^8.1
- illuminate/support: ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
Requires (Dev)
- orchestra/testbench: ^9.0
- phpunit/phpunit: ^10.0
README
Blade component package to easily use Calcite UI Icons in Laravel applications.
This package provides a clean and simple way to render Calcite UI Icons using Blade components with configurable defaults, publishable configuration, and test support.
๐ฆ Installation
Install the package via Composer:
composer require ihahachi/calcite-ui-icons
Laravel automatically discovers the service provider.
๐ Usage
Use the icon component directly in your Blade views.
<x-calcite-icon icon="layer" />
With custom class:
<x-calcite-icon icon="search" class="w-6 h-6 text-gray-500" />
With scale:
<x-calcite-icon icon="user" scale="l" />
Full example:
<div class="flex items-center gap-2"> <x-calcite-icon icon="user" class="w-5 h-5 text-blue-500" /> <span>User Section</span> </div>
๐ฏ Icon Names
All available icons come from the Calcite UI Icons library.
Browse icons here:
https://esri.github.io/calcite-ui-icons/
Copy the icon name and use it in the component.
Example:
user
search
download
upload
layer
plus
minus
trash
Usage:
<x-calcite-icon icon="download" />
๐งฉ Component Props
| Prop | Type | Default | Description |
|---|---|---|---|
| icon | string | required | Icon name from Calcite UI Icons |
| class | string | config value | CSS classes |
| scale | string | m | Icon scale (s, m, l) |
Example:
<x-calcite-icon icon="download" class="w-6 h-6" scale="l" />
โ๏ธ Configuration
Publish the config file:
php artisan vendor:publish --tag=calcite-icons-config
This will create:
config/calcite-icons.php
๐ Config File
return [ 'class' => 'w-5 h-5', 'scale' => 'm', 'auto_load' => true, ];
Available Options
| Option | Description |
|---|---|
| class | Default icon class |
| scale | Default icon scale |
| auto_load | Auto load Calcite UI script |
๐งช Testing
Run tests using PHPUnit.
vendor/bin/phpunit
or
composer test
๐ค Contributing
Contributions are welcome.
- Fork the repository
- Create a branch
git checkout -b feature/new-feature
- Commit changes
git commit -m "Add new feature"
- Push
git push origin feature/new-feature
- Create Pull Request
๐ License
MIT License
โค๏ธ Credits
- Calcite UI Icons
๐ Resources
Calcite UI Icons
https://esri.github.io/calcite-ui-icons/
โญ Support
If you find this package useful, please consider giving it a star on GitHub.