PHPackages                             stefanfisk/vy - 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. stefanfisk/vy

ActiveLibrary[Templating &amp; Views](/categories/templating)

stefanfisk/vy
=============

A simple view library inspired by React.

v1.0.0-beta.9(2y ago)1884[5 PRs](https://github.com/stefanfisk/vy/pulls)MITHTMLPHP ^8.1CI passing

Since Aug 19Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/stefanfisk/vy)[ Packagist](https://packagist.org/packages/stefanfisk/vy)[ RSS](/packages/stefanfisk-vy/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (22)Used By (0)

stefanfisk/vy
=============

[](#stefanfiskvy)

 **A simple view library inspired by React.**

 [![Source Code](https://camo.githubusercontent.com/b1ff09a0a224cbb70d68aea606c579dcceed1d09053f45aaf9a7959e9261f21c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d73746566616e6669736b2f76792d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/stefanfisk/vy) [![Download Package](https://camo.githubusercontent.com/9da25b78cff17baeaa255eab51c39b9b5eba43f545e15ebc3c0f65a297074bc4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73746566616e6669736b2f76792e7376673f7374796c653d666c61742d737175617265266c6162656c3d72656c65617365)](https://packagist.org/packages/stefanfisk/vy) [![PHP Programming Language](https://camo.githubusercontent.com/482f92b8e089d07ca57eaa5af3c6fcee09824e575b694e37f815cc12e530dc02/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f73746566616e6669736b2f76792e7376673f7374796c653d666c61742d73717561726526636f6c6f72423d253233383839324246)](https://php.net) [![Read License](https://camo.githubusercontent.com/39b00c44258a0e9bad5acce7e44627db4ee3f30c5a3931653628f32f5a3e2006/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73746566616e6669736b2f76792e7376673f7374796c653d666c61742d73717561726526636f6c6f72423d6461726b6379616e)](https://github.com/stefanfisk/vy/blob/main/LICENSE) [![Build Status](https://camo.githubusercontent.com/eb0168b2c392aa3661cac65b5e04b5af178f4ff1e5fffa689761ce1d1abbd6de/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73746566616e6669736b2f76792f636f6e74696e756f75732d696e746567726174696f6e2e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265266c6f676f3d676974687562)](https://github.com/stefanfisk/vy/actions/workflows/continuous-integration.yml) [![Codecov Code Coverage](https://camo.githubusercontent.com/2cc254d70c2faa6cad74c5bb60d6c30d08dda71c40be2a701c8e927a0d49f41b/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f67682f73746566616e6669736b2f76793f6c6162656c3d636f6465636f76266c6f676f3d636f6465636f76267374796c653d666c61742d737175617265)](https://codecov.io/gh/stefanfisk/vy) [![Psalm Type Coverage](https://camo.githubusercontent.com/13cf837f19f42686c50c6bb40d269d0114bb5a058524f7083d6d50c3034e25d2/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742d7371756172652675726c3d687474707325334125324625324673686570686572642e64657625324667697468756225324673746566616e6669736b2532467679253246636f766572616765)](https://shepherd.dev/github/stefanfisk/vy)

About
-----

[](#about)

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

[](#installation)

Install this package as a dependency using [Composer](https://getcomposer.org).

```
composer require stefanfisk/vy
```

Usage
-----

[](#usage)

Below is a minimal example. Check out the [examples](./examples/) for more.

```
namespace StefanFisk\Vy\Example;

use StefanFisk\Vy\Serialization\Html\UnsafeHtml;
use StefanFisk\Vy\Vy;

use function StefanFisk\Vy\el;

class MyPage
{
    public static function el(string $title): Element
    {
        return Element::create(self::render(...), [
            'title' => $title,
        ]);
    }

    private static function render(string $title, mixed $children = null): mixed
    {
        return [
            UnsafeHtml::from(''),
            html::el(lang: 'en')(
                head::el()(
                    meta::el(charset: 'UTF-8'),
                    title::el()($title),
                ),
                body::el()(
                    $children,
                ),
            ),
        ];
    }
}

$el = MyPage::el(
    title: 'Hello, world!',
)(
    h1::el()(
        'Hello, world!',
    ),
    p::el()(
        'This is a test page. There are many like it, but this one is mine.',
    ),
);

$vy = new Vy();

echo $vy->render($el);
```

Contributing
------------

[](#contributing)

Contributions are welcome! To contribute, please familiarize yourself with [CONTRIBUTING.md](CONTRIBUTING.md).

Coordinated Disclosure
----------------------

[](#coordinated-disclosure)

Keeping user information safe and secure is a top priority, and we welcome the contribution of external security researchers. If you believe you've found a security issue in software that is maintained in this repository, please read [SECURITY.md](SECURITY.md) for instructions on submitting a vulnerability report.

Copyright and License
---------------------

[](#copyright-and-license)

stefanfisk/vy is copyright © [Stefan Fisk](https://stefanfisk.com)and licensed for use under the terms of the MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance60

Regular maintenance activity

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88% 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.

###  Release Activity

Cadence

Every ~8 days

Recently: every ~14 days

Total

10

Last Release

925d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c8b2e63226706abd2dd2ee21d2ed79a3f03a50425d1f479d0c6555ecfe4494a2?d=identicon)[stefanfisk](/maintainers/stefanfisk)

---

Top Contributors

[![stefanfisk](https://avatars.githubusercontent.com/u/827773?v=4)](https://github.com/stefanfisk "stefanfisk (161 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (22 commits)")

---

Tags

php-libraryreacttemplate-enginetemplatingreactreactive

###  Code Quality

Static AnalysisRector

### Embed Badge

![Health badge](/badges/stefanfisk-vy/health.svg)

```
[![Health](https://phpackages.com/badges/stefanfisk-vy/health.svg)](https://phpackages.com/packages/stefanfisk-vy)
```

###  Alternatives

[twig/twig

Twig, the flexible, fast, and secure template language for PHP

8.4k443.2M5.8k](/packages/twig-twig)[mustache/mustache

A Mustache implementation in PHP.

3.3k44.6M291](/packages/mustache-mustache)[smarty/smarty

Smarty - the compiling PHP template engine

2.3k39.1M395](/packages/smarty-smarty)[league/plates

Plates, the native PHP template system that's fast, easy to use and easy to extend.

1.5k5.9M232](/packages/league-plates)[eftec/bladeone

The standalone version Blade Template Engine from Laravel in a single php file

8208.4M87](/packages/eftec-bladeone)[laminas/laminas-view

Fast and type safe HTML templating library with a flexible plugin system supporting multistep template composition

7526.3M230](/packages/laminas-laminas-view)

PHPackages © 2026

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