--- title: "contact-18" description: "Locations list beside a map: pick an office from the list and its map shows next to it. CSS only, no script." category: "Contact" --- # contact-18 Locations list beside a map: pick an office from the list and its map shows next to it. CSS only, no script. ## Installation ```bash php artisan ui:add-block contact-18 ``` ## Dependencies - composer: `gehrisandro/tailwind-merge-laravel` - component: [radio](https://laralcn-ui.abdulkadersafi.com/ar/components/radio.md) — the CLI installs it for you. ## Source `resources/views/components/ui/blocks/contact-18.blade.php` ```blade {{-- Locations list beside a map. Picking an office in the list shows its map next to it. It works with no script: each office is a visually hidden radio, so the list is keyboard friendly (Tab in, arrow keys to move) and the selected map follows `:checked` in CSS. Every piece of content is a prop. A location is ['name' => ..., 'address' => ...] plus an optional 'map', an embed URL. No map is embedded by default: the panel shows a placeholder until you pass 'map', which renders as a lazy-loaded iframe titled with the location name (or 'mapTitle'). Give each instance on a page its own `id`. --}} @props([ 'id' => 'contact-18', 'tagline' => 'Tagline', 'heading' => 'Locations', 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'locations' => [ ['name' => 'Sydney', 'address' => '123 Sample St, Sydney NSW 2000 AU'], ['name' => 'New York', 'address' => '123 Sample St, New York NY 10000 USA'], ['name' => 'London', 'address' => '123 Sample St, London W1C 1DE, United Kingdom'], ], 'actionLabel' => 'View Map', ])
merge(['class' => 'w-full bg-background px-[5%] py-16 text-foreground md:py-24 lg:py-28']) }}>
@if ($tagline)

{{ $tagline }}

@endif

{{ $heading }}

@if ($description)

{{ $description }}

@endif
{{-- The panels sit absolutely in the right column (below the list on mobile), so each one can stay a sibling of its own radio. The bottom padding reserves the 335:320 panel on mobile. --}}
@foreach ($locations as $i => $location) @php($mapTitle = $location['mapTitle'] ?? ($location['name'] ?? 'Map'))
@endforeach
```