An open API service indexing awesome lists of open source software.

https://github.com/yassinedoghri/tempest-icons

A Tempest library providing a convenient `icon(…)` function for rendering SVG icons with https://github.com/yassinedoghri/php-icons
https://github.com/yassinedoghri/tempest-icons

iconify icons php php-icons tempest

Last synced: 6 months ago
JSON representation

A Tempest library providing a convenient `icon(…)` function for rendering SVG icons with https://github.com/yassinedoghri/php-icons

Awesome Lists containing this project

README

          

# Tempest Icons 🌊 🙂

A [Tempest](https://tempestphp.com/) library providing a convenient `icon(…)`
function for rendering SVG icons with
[php-icons](https://github.com/yassinedoghri/php-icons).

[![Latest Stable Version](https://poser.pugx.org/yassinedoghri/tempest-icons/v)](https://packagist.org/packages/yassinedoghri/tempest-icons)
[![Total Downloads](https://poser.pugx.org/yassinedoghri/tempest-icons/downloads)](https://packagist.org/packages/yassinedoghri/tempest-icons)
[![License](https://img.shields.io/github/license/yassinedoghri/tempest-icons?color=green)](https://packagist.org/packages/yassinedoghri/tempest-icons)
[![PHP Version Require](https://poser.pugx.org/yassinedoghri/tempest-icons/require/php)](https://packagist.org/packages/yassinedoghri/tempest-icons)

## 🚀 Getting started

### 0. Prerequisites

Usage of Tempest Icons requires the following:

- A Tempest based project
- Composer for package management
- PHP 8.3+

### 1. Install via composer

```sh
composer require yassinedoghri/tempest-icons
```

### 2. Setup

[Initialize and configure PHPIcons](https://github.com/yassinedoghri/php-icons),
ie. create the `php-icons.php` config file:

```sh
vendor/bin/php-icons init
```

### 3. Usage

Use the `icon(string $iconKey, array $attributes)` function anywhere in your
View files to render SVG icons:

```php
= icon('material-symbols:bolt') ?>
//
//
//

= icon('material-symbols:bolt', ['class' => 'text-2xl', "style" => "color: yellow;"]) ?>
// ...

= icon('material-symbols:bolt')
->attr('class', 'text-2xl')
->attr('style', 'color: yellow;') ?>
// ...
```

For more usage info, see
[php icons docs](https://github.com/yassinedoghri/php-icons).

## 📜 License

Code released under the [MIT License](https://choosealicense.com/licenses/mit/).

Copyright (c) 2024-present, Yassine Doghri
([@yassinedoghri](https://yassinedoghri.com/)).