--- title: "gallery-12" description: "Centred single-image slider with round arrows outside the image on both sides and dots below." category: "Gallery" --- # gallery-12 Centred single-image slider with round arrows outside the image on both sides and dots below. ## Installation ```bash php artisan ui:add-block gallery-12 ``` ## Dependencies - composer: `gehrisandro/tailwind-merge-laravel` - component: [button](https://laralcn-ui.abdulkadersafi.com/ar/components/button.md) — the CLI installs it for you. - component: [carousel](https://laralcn-ui.abdulkadersafi.com/ar/components/carousel.md) — the CLI installs it for you. ## Source `resources/views/components/ui/blocks/gallery-12.blade.php` ```blade {{-- Every piece of content is a prop. An image is ['src' => ..., 'alt' => ...]; leave src empty to show a placeholder. One centred 3:2 image per view. From md up the image narrows so the round arrows sit outside it on both sides; dots below. --}} @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'], ], 'previousLabel' => 'Previous slide', 'nextLabel' => 'Next slide', 'dotLabel' => 'Go to slide', ])
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 {{-- Centred on the slides: half of the dots row (3rem gap + 28px) is taken off. --}}
```