Цю сторінку ще не перекладено українською, тому нижче англійська версія.

thumbnails() html()

A grid of image thumbnails with optional titles and captions.

html()->thumbnails($data = [], $extra = [])

Опції

ОпціяЗначення
$dataItems: an image URL, or ['img', 'alt', 'head', 'body' (HTML), 'link'].
columnsPer row; default 3.
class, idClasses; id.

Приклад

With a title

With a title

300x200

Title and text

Captions are HTML.

Action

Another one

Another one

Код

$img = fn ($color) => 'data:image/svg+xml,' . rawurlencode('<svg xmlns="http://www.w3.org/2000/svg" width="300" height="200"><rect width="300" height="200" fill="' . $color . '"/></svg>');
return html()->thumbnails([
    ['img' => $img('#337ab7')],
    ['img' => $img('#5cb85c'), 'head' => 'With a title'],
    ['img' => $img('#f0ad4e'), 'alt' => '300x200', 'head' => 'Title and text', 'body' => '<p>Captions are HTML.</p><p><a href="#" class="btn btn-primary">Action</a></p>'],
    $img('#5bc0de'),
    ['img' => $img('#d9534f'), 'head' => 'Another one'],
    $img('#777777'),
], ['columns' => 3]);

Bootstrap 3 and 5

Bootstrap 3 thumbnails; Bootstrap 5 cards in a row.

Див. також: html/media_objects, html/carousel