Skip to content
Guides
Navigation
Feedback
Overlays
Layout
Data Display
Forms
.md

Gallery

gallery-09

Masonry image gallery with a centred heading and description: square and wide images flow into three columns, one on mobile.

Open full screen

Installation

php artisan ui:add-block gallery-09

A single command installs the block's Blade file and every component it depends on. Render it in your own layout as <x-ui.blocks.gallery-09 />.

Components it includes

Usage

Every piece of content is a prop. An image is ['src' => ..., 'alt' => ...]; leave src empty to show a placeholder. Images flow down the first column, then the next (CSS columns). Add 'wide' => true to an image to make it 16:9 instead of square.

<x-ui.blocks.gallery-09
    heading="Our work"
    description="A few recent projects."
    :images="[
        ['src' => '/images/gallery/1.jpg', 'alt' => 'Photo 1'],
        ['src' => '/images/gallery/2.jpg', 'alt' => 'Photo 2'],
        ['src' => '/images/gallery/3.jpg', 'alt' => 'Photo 3', 'wide' => true],
    ]"
/>

Props

Every prop with its default. Pass any of them as attributes, using : to bind a PHP value.

@props([
    'heading' => 'Image Gallery',
    'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
    'images' => [
        ['src' => null, 'alt' => 'Placeholder image 1'],
        ['src' => null, 'alt' => 'Placeholder image 2'],
        ['src' => null, 'alt' => 'Placeholder image 3', 'wide' => true],
        ['src' => null, 'alt' => 'Placeholder image 4', 'wide' => true],
        ['src' => null, 'alt' => 'Placeholder image 5'],
        ['src' => null, 'alt' => 'Placeholder image 6'],
        ['src' => null, 'alt' => 'Placeholder image 7'],
    ],
])