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

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.

Open full screen

Installation

php artisan ui:add-block contact-18

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.contact-18 />.

Components it includes

Usage

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`.

<x-ui.blocks.contact-18
    id="offices"
    tagline="Offices"
    heading="Where to find us"
    description="Pick a studio to see it on the map."
    :locations="[
        ['name' => 'Sydney', 'address' => '1 Market St, Sydney NSW 2000', 'map' => 'https://www.openstreetmap.org/export/embed.html?bbox=151.20,-33.87,151.21,-33.86'],
        ['name' => 'Auckland', 'address' => '2 Queen St, Auckland 1010'],
    ]"
    action-label="Show on map"
/>

Props

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

@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',
])