Guide

Components

A component registry for metadata, breadcrumbs, pagination, and custom components.

Register custom components

Custom components are application helpers registered through Components.yaml and resolved from ComponentRegistry.

example.php
<?php

use App\Component\NavigationComponent;
use Lemonade\Framework\Component\ComponentRegistry;

final class LayoutComposer
{
    public function __construct(
        private readonly ComponentRegistry $components,
    ) {}

    public function navigation(): array
    {
        $navigation = $this->components->get('navigation', NavigationComponent::class);

        return $navigation->items();
    }
}

Page metadata

Use MetaData with the framework meta component when a page needs an explicit title, description, canonical URL, image, or other metadata.

example.php
use Lemonade\Framework\Component\Meta\MetaData;

$meta = new MetaData(
    title: 'Article detail',
    description: 'Public article page.',
);

echo $component->meta()->render($meta);

Breadcrumbs and pagination

Breadcrumbs and pagination are built-in building blocks for navigation context and paginated lists.

example.php
$breadcrumbs = $component->breadcrumb()->render($trail);
$pagination = $component->pagination()->render($result);