PHPackages                             fabianmichael/kirby-template-attributes - 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. [Templating &amp; Views](/categories/templating)
4. /
5. fabianmichael/kirby-template-attributes

ActiveKirby-plugin[Templating &amp; Views](/categories/templating)

fabianmichael/kirby-template-attributes
=======================================

Better HTML attribute handling for your snippets and templates.

2.3.3(2mo ago)236.8k↓41.7%1[1 PRs](https://github.com/fabianmichael/kirby-template-attributes/pulls)1MITPHP

Since Feb 21Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/fabianmichael/kirby-template-attributes)[ Packagist](https://packagist.org/packages/fabianmichael/kirby-template-attributes)[ Docs](https://github.com/fabianmichael/kirby-template-attributes)[ GitHub Sponsors](https://github.com/fabianmichael)[ RSS](/packages/fabianmichael-kirby-template-attributes/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (14)Versions (13)Used By (1)

Kirby Template Attributes
=========================

[](#kirby-template-attributes)

**Better attribute API for snippets and templates**

This plugin brings [Vue.js](https://vuejs.org)/[Laravel-Blade](https://laravel.com/docs/9.x/blade#components)-like attribute composition to the templates of your [Kirby project](https://getkirby.com). This is an exploration in search of better HTML attribute handling for nested snippets and components.

Note

This plugin is completely free and published under the MIT license. However, if you are using it in a commercial project and want to help me keep up with maintenance, please consider to **[❤️ sponsor me](https://github.com/sponsors/fabianmichael)** for securing the continued development of the plugin.

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

[](#requirements)

- Kirby 4/5 (use version 1.x for Kirby 3 installations)
- PHP 8.3 (because of [Enumeration](https://www.php.net/manual/en/language.types.enumerations.php) support)

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

[](#installation)

The recommended is installation via composer.

```
composer require fabianmichael/kirby-template-attributes

```

Alternatively, you can also [download the plugin](https://github.com/fabianmichael/kirby-template-attributes/archive/main.zip) and install it manually by copying it to the `site/plugins/` folder of your website.

Usage
-----

[](#usage)

### Basic usage

[](#basic-usage)

Use the `attributes()` helper for generating a string of attributes:

```
