PHP code example of innmind / ui

1. Go to this page and download the library: Download innmind/ui library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

innmind / ui example snippets


use Innmind\UI\{
    Button,
    Card,
    Grid,
    Image,
    NavigationLink,
    Shape,
    Stack,
    Text,
    Toolbar,
    Window,
};
use Innmind\Url\Url;
use Innmind\Immutable\Sequence;

$window = Window::of('Graphs', Stack::vertical(
    Toolbar::of(Text::of('Organizations'))
        ->trailing(Button::text(Url::of('/add'), '+ Add')),
    Grid::of(
        Sequence::of(...$strings)
            ->map(Text::of(...))
            ->map(static fn(Text $label) => Stack::vertical(
                Image::of(Url::of('https://avatars.githubusercontent.com/u/12136170?s=150&v=4'))
                    ->shape(Shape::circle),
                $label,
            ))
            ->map(static fn(Stack $label) => NavigationLink::of(
                Url::of('package.php'),
                $label,
            ))
            ->map(Card::of(...)),
    ),
))->stylesheet(Url::of('/themes/default.css'));

echo $window->render()->toString();