PHPackages                             marko/layout - 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. [Framework](/categories/framework)
4. /
5. marko/layout

ActiveLibrary[Framework](/categories/framework)

marko/layout
============

Marko Framework Layout - Layout system with components and slots

0.8.4(1mo ago)070MITPHPPHP ^8.5

Since Apr 10Pushed 1mo agoCompare

[ Source](https://github.com/marko-php/marko-layout)[ Packagist](https://packagist.org/packages/marko/layout)[ RSS](/packages/marko-layout/feed)WikiDiscussions develop Synced 3w ago

READMEChangelogDependencies (10)Versions (17)Used By (0)

marko/layout
============

[](#markolayout)

Composable layout system with slot-based injection---define layouts and components with attributes, not configuration files.

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

[](#installation)

```
composer require marko/layout
```

Quick Example
-------------

[](#quick-example)

Define a layout component with named slots:

```
use Marko\Layout\Attributes\Component;

#[Component(
    template: 'blog::layout/default',
    slots: ['content', 'sidebar'],
)]
class DefaultLayout {}
```

Point a controller action at that layout:

```
use Marko\Layout\Attributes\Layout;
use Marko\Routing\Attributes\Get;
use Marko\Routing\Http\Response;

class PostController
{
    #[Get('/posts/{id}')]
    #[Layout(DefaultLayout::class)]
    public function show(int $id): Response
    {
        return new Response();
    }
}
```

Inject a page component into a slot from any module:

```
#[Component(
    template: 'blog::post/body',
    handle: 'post_show',
    slot: 'content',
)]
class PostBodyComponent {}
```

The layout middleware assembles all components targeting the current handle and renders the final page---no wiring required.

Documentation
-------------

[](#documentation)

Full usage, API reference, and examples: [marko/layout](https://marko.build/docs/packages/layout/)

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance93

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90% 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 ~4 days

Total

15

Last Release

42d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/437029?v=4)[Mark Shust](/maintainers/markshust)[@markshust](https://github.com/markshust)

---

Top Contributors

[![markshust](https://avatars.githubusercontent.com/u/437029?v=4)](https://github.com/markshust "markshust (9 commits)")[![michalbiarda](https://avatars.githubusercontent.com/u/1135380?v=4)](https://github.com/michalbiarda "michalbiarda (1 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/marko-layout/health.svg)

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

PHPackages © 2026

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