--- title: "gallery-09" description: "Masonry image gallery with a centred heading and description: square and wide images flow into three columns, one on mobile." category: "Gallery" --- # gallery-09 Masonry image gallery with a centred heading and description: square and wide images flow into three columns, one on mobile. ## Installation ```bash php artisan ui:add-block gallery-09 ``` ## Dependencies - composer: `gehrisandro/tailwind-merge-laravel` - component: [aspect-ratio](https://laralcn-ui.abdulkadersafi.com/ar/components/aspect-ratio.md) — the CLI installs it for you. ## Source `resources/views/components/ui/blocks/gallery-09.blade.php` ```blade {{-- 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. --}} @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'], ], ])
merge(['class' => 'w-full bg-background px-[5%] py-16 text-foreground md:py-24 lg:py-28']) }}>

{{ $heading }}

{{ $description }}

@foreach ($images as $image)
@if (!empty($image['src'])) {{ $image['alt'] ?? '' }} @else @endif
@endforeach
```