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

05PHP

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 today

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 1% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity4

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://avatars.githubusercontent.com/u/5142881?v=4)[Tim Ötting](/maintainers/TimOetting)[@TimOetting](https://github.com/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

[goat1000/svggraph

Generates SVG graphs

135911.1k3](/packages/goat1000-svggraph)[gravatarphp/gravatar

Gravatar URL builder which is most commonly called as a Gravatar library

16653.6k2](/packages/gravatarphp-gravatar)[rsoury/wp-imgix

Rewrites WordPress image URLs to use ImgIX

167.2k](/packages/rsoury-wp-imgix)

PHPackages © 2026

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