ozzyczech / latte-lucide-icons
A package to easily make use of Lucide icons in your Latte templates.
v0.0.5
2025-06-25 06:09 UTC
Requires
- php: ^8.1
- ext-dom: *
- latte/latte: ^3.0.9
- nette/application: ^3.1
- nette/di: ^3.1.2
- nette/schema: ^1.2
README
Latte Lucide Icons
This package provides a Latte macro {lucide}
for
rendering Lucide icons in your Latte / Nette application.
🚀 Installation
composer require ozzyczech/latte-lucide-icons
Requirements:
- PHP 8.1+
- Nette 3.2+
⚙️ Setup
Option 1: Register via services.neon
extensions: lucideIcons: OzzyCzech\LucideIcons\NetteExtension
Option 2: Register via common.neon
(with custom Latte setup)
latte: strictTypes: yes strictParsing: yes extensions: - App\Presentation\Accessory\LatteExtension - OzzyCzech\LucideIcons\LatteExtension
Option 3: Register the macro manually
You can also register macro manually:
class MySuperExtensions extends Latte\Extension { public function getTags(): array { return [ 'lucide' => OzzyCzech\LucideIcons\LucideNode::create(...), ]; } }
🧪 Usage
Use the macro directly in your .latte
templates:
<button type="button"> {lucide "check" class => "text-green-500"} Lucide Check Icon </button>
This renders the following HTML:
<button type="button"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check-icon lucide-check text-green-500"> <path d="M20 6 9 17l-5-5"/> </svg> </button>
👨🔧 Maintainer
Maintained by Roman Ožana. Contributions are welcome via issues or pull requests.
📄 License
Latte Lucide Icons is open-sourced software licensed under the MIT license.