Search by

rem42 / sylius-ui-show-bundle

rem42

Configuration-driven "show" pages for the Sylius Stack (Admin UI, Bootstrap Admin UI or Shadcn Admin UI, Twig Hooks) and any Symfony application.

Package info

github.com/rem42/sylius-ui-show-bundle

Type:symfony-bundle

pkg:composer/rem42/sylius-ui-show-bundle

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-10-31 16:18 UTC

This package is auto-updated.

Last update: 2026-10-31 17:10:18 UTC


README

Build License

Configuration-driven "show" pages for the Sylius Stack and any Symfony application.

The Sylius Grid describes index pages in PHP; this bundle does the same for show pages. Describe tabs, cards, columns and fields in a PHP class, and get it rendered with the markup of your admin UI (bootstrap theme for sylius/bootstrap-admin-ui, shadcn theme for rem42/shadcn-admin-ui), automatically on your Sylius Admin UI show pages through Twig Hooks.

Features

  • #[AsShow] attribute: invokable show definitions, just like #[AsGrid].
  • Sylius Stack integration: rendered automatically in the sylius_admin.common.show.content Twig Hook, configurable per resource.
  • Layouts: sections, responsive columns, cards, tabs, side navigation, details tables, datagrids, custom templates, Twig Hooks.
  • 16 field types: string, number, boolean, datetime, enum, association, collection (table), badge, status, progress, image, icon, URL, file, sensitive, twig.
  • Field guessing: ->add('name', 'createdAt', 'category') guesses types from Doctrine, PHP types and naming conventions.
  • Extensible: one template per element type, custom element types, custom guessers, ShowBuildEvent, decoratable services.

Installation

composer require rem42/sylius-ui-show-bundle
// config/bundles.php (without Symfony Flex)
Rem42\SyliusUiShow\Symfony\Rem42SyliusUiShowBundle::class => ['all' => true],

Quick start

namespace App\Show;

use App\Entity\Book;
use Rem42\SyliusUiShow\Attribute\AsShow;
use Rem42\SyliusUiShow\Builder\ShowBuilder;
use Rem42\SyliusUiShow\Model\Field\EnumField;
use Rem42\SyliusUiShow\Model\Field\StringField;
use Rem42\SyliusUiShow\Model\Layout\Card;
use Rem42\SyliusUiShow\Model\Layout\Column;
use Rem42\SyliusUiShow\Model\Layout\Section;

#[AsShow(resourceClass: Book::class)]
final class BookShow
{
    public function __invoke(ShowBuilder $show, Book $book): void
    {
        $show->withChildren(
            Section::create('main')->withChildren(
                Column::create(8)->withChildren(
                    Card::create('general')
                        ->withChildren(StringField::create('description')->setMultiline())
                        ->add('title', 'author', 'publishedAt'),   // types guessed
                ),
                Column::create(4)->withChildren(
                    Card::create('status')->withChildren(
                        EnumField::create('state')->setBadge(['published' => 'success', 'draft' => 'secondary']),
                    ),
                ),
            ),
        );
    }
}

With the Sylius Stack, add a new Show() operation to your resource: the show is rendered on its admin show page.

Anywhere else, render it in Twig:

{{ rem42_sylius_ui_show(book) }}

Documentation

📖 Read the documentation

Development

make install   # composer install
make ci        # ECS + PHPStan (level max) + PHPUnit
make up        # demo application showcasing every element, in both themes:
               # http://localhost:8080/admin/show/product/1 (bootstrap)
               # http://localhost:8080/shadcn/admin/show/product/1 (shadcn)

The demo application lives in tests/Application (App\Show\ProductShow is a good tour of the API). Each theme runs in its own kernel (App\Kernel): bundles flagged with its name in config/bundles.php, configuration of config/packages/{theme}/ and templates of templates/themes/{theme}/. The shadcn theme needs its assets: make assets (Tailwind CSS build and importmap).

License

This bundle is released under the MIT License.