PHPackages                             tim-oetting/lucide-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. tim-oetting/lucide-php

ActiveLibrary[Image &amp; Media](/categories/media)

tim-oetting/lucide-php
======================

A modern PHP package for Lucide icons

02PHP

Since Dec 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/TimOetting/lucide-php)[ Packagist](https://packagist.org/packages/tim-oetting/lucide-php)[ RSS](/packages/tim-oetting-lucide-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Lucide PHP
==========

[](#lucide-php)

A modern PHP package for integrating [Lucide icons](https://lucide.dev) into your PHP projects.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require tim-oetting/lucide-php
```

Requirements
------------

[](#requirements)

- PHP 8.0 or higher

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

```
use TimOetting\LucidePhp\Lucide;

// Using the static icon method
echo Lucide::icon('github');

// Using magic method (alternative syntax)
echo Lucide::github();
```

### Customizing Icons

[](#customizing-icons)

The package provides a fluent interface to customize your icons:

```
// Add CSS classes
echo Lucide::github()->withClass('w-6 h-6 text-gray-500');

// Set custom size
echo Lucide::github()->withSize(24);

// Add custom attributes
echo Lucide::github()->withAttributes([
    'class' => 'icon',
    'stroke-width' => '1.5',
    'aria-hidden' => 'true'
]);

// Chain methods
echo Lucide::github()
    ->withSize(32)
    ->withClass('text-blue-500')
    ->withAttributes(['stroke-width' => '1.5']);
```

### Error Handling

[](#error-handling)

The package will throw an `IconNotFoundException` if the requested icon doesn't exist:

```
try {
    echo Lucide::nonexistentIcon();
} catch (TimOetting\LucidePhp\IconNotFoundException $e) {
    // Handle the error
}
```

How It Works
------------

[](#how-it-works)

The package loads SVG icons from the icons directory and allows you to manipulate them with various attributes. All icons are rendered as inline SVG, making them easy to style with CSS.

Features
--------

[](#features)

- 🚀 Simple and intuitive API
- ⚡️ Fluent interface for icon customization
- 🎨 Full support for custom attributes
- 🔒 Secure SVG rendering with proper HTML escaping
- 💪 Type-safe with PHP 8.0 features
- 🎯 Zero dependencies

License
-------

[](#license)

The MIT License (MIT). Please see the [License File](LICENSE.md) for more information.

Credits
-------

[](#credits)

- [Tim Oetting](https://github.com/tim-oetting)
- [Lucide Icons](https://lucide.dev)

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1b078d7b5e2a6d7b6b5845cdb6db319504d0089d84d88e364d3e7699e5eecd42?d=identicon)[TimOetting](/maintainers/TimOetting)

---

Top Contributors

[![TimOetting](https://avatars.githubusercontent.com/u/5142881?v=4)](https://github.com/TimOetting "TimOetting (2 commits)")

### Embed Badge

![Health badge](/badges/tim-oetting-lucide-php/health.svg)

```
[![Health](https://phpackages.com/badges/tim-oetting-lucide-php/health.svg)](https://phpackages.com/packages/tim-oetting-lucide-php)
```

###  Alternatives

[milon/barcode

Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)

1.5k13.3M39](/packages/milon-barcode)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k22](/packages/bkwld-croppa)[marc1706/fast-image-size

fast-image-size is a PHP library that does almost everything PHP's getimagesize() does but without the large overhead of downloading the complete file.

959.4M20](/packages/marc1706-fast-image-size)[char0n/ffmpeg-php

PHP wrapper for FFmpeg application

495225.1k1](/packages/char0n-ffmpeg-php)[goat1000/svggraph

Generates SVG graphs

132849.6k3](/packages/goat1000-svggraph)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
