Contact
contact-14
Three left-aligned columns for email, phone and office, each with a large icon, short text and a link.
{{--
Three left-aligned columns for email, phone and office. Every piece of content
is a prop. Set any of email, phone or address to null to hide that
column. The address links to a Google Maps search for it unless you pass
`address-href`.
<x-ui.blocks.contact-14
email-description="Questions about an order or your account."
email="hello@acme.test"
phone-description="Mon to Fri, 9am to 5pm AEST."
phone="+61 2 5550 0000"
address-description="Come and see the workshop."
address="1 Market St, Sydney NSW 2000"
/>
--}}
@props([
'emailTitle' => 'Email',
'emailDescription' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in ero.',
'email' => 'email@example.com',
'phoneTitle' => 'Phone',
'phoneDescription' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in ero.',
'phone' => '+1 (555) 000-0000',
'addressTitle' => 'Office',
'addressDescription' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in ero.',
'address' => '123 Sample St, Sydney NSW 2000 AU',
'addressHref' => null,
])
@php
$tel = $phone ? 'tel:' . preg_replace('/[^\d+]/', '', $phone) : null;
$directions = $addressHref ?? ($address ? 'https://www.google.com/maps/search/?api=1&query=' . urlencode($address) : null);
@endphp
<section {{ $attributes->merge(['class' => 'w-full bg-background px-[5%] py-16 text-foreground md:py-24 lg:py-28']) }}>
<div class="mx-auto grid max-w-7xl grid-cols-1 gap-12 md:grid-cols-3">
@if ($email)
<div class="flex flex-col items-start gap-5 text-start md:gap-6">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="size-12"
aria-hidden="true">
<rect width="20" height="16" x="2" y="4" rx="2" />
<path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7" />
</svg>
<div class="flex flex-col items-start gap-5 md:gap-6">
<div class="flex flex-col gap-3 md:gap-4">
<h3 class="text-2xl font-bold leading-[1.3] md:text-[2rem]">{{ $emailTitle }}</h3>
@if ($emailDescription)
<p>{{ $emailDescription }}</p>
@endif
</div>
<a href="mailto:{{ $email }}" class="underline underline-offset-4">{{ $email }}</a>
</div>
</div>
@endif
@if ($phone)
<div class="flex flex-col items-start gap-5 text-start md:gap-6">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="size-12"
aria-hidden="true">
<path
d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z" />
</svg>
<div class="flex flex-col items-start gap-5 md:gap-6">
<div class="flex flex-col gap-3 md:gap-4">
<h3 class="text-2xl font-bold leading-[1.3] md:text-[2rem]">{{ $phoneTitle }}</h3>
@if ($phoneDescription)
<p>{{ $phoneDescription }}</p>
@endif
</div>
<a href="{{ $tel }}" class="underline underline-offset-4" dir="ltr">{{ $phone }}</a>
</div>
</div>
@endif
@if ($address)
<div class="flex flex-col items-start gap-5 text-start md:gap-6">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="size-12"
aria-hidden="true">
<path
d="M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0" />
<circle cx="12" cy="10" r="3" />
</svg>
<div class="flex flex-col items-start gap-5 md:gap-6">
<div class="flex flex-col gap-3 md:gap-4">
<h3 class="text-2xl font-bold leading-[1.3] md:text-[2rem]">{{ $addressTitle }}</h3>
@if ($addressDescription)
<p>{{ $addressDescription }}</p>
@endif
</div>
<a href="{{ $directions }}" class="underline underline-offset-4">{{ $address }}</a>
</div>
</div>
@endif
</div>
</section>
Installation
php artisan ui:add-block contact-14
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-14
/>.
1. Install component dependencies
This block has no component dependencies.
2. External packages
- composer:
gehrisandro/tailwind-merge-laravel
3.
Copy the block source into
resources/views/components/ui/
resources/views/components/ui/blocks/contact-14.blade.php
{{--
Three left-aligned columns for email, phone and office. Every piece of content
is a prop. Set any of email, phone or address to null to hide that
column. The address links to a Google Maps search for it unless you pass
`address-href`.
<x-ui.blocks.contact-14
email-description="Questions about an order or your account."
email="hello@acme.test"
phone-description="Mon to Fri, 9am to 5pm AEST."
phone="+61 2 5550 0000"
address-description="Come and see the workshop."
address="1 Market St, Sydney NSW 2000"
/>
--}}
@props([
'emailTitle' => 'Email',
'emailDescription' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in ero.',
'email' => 'email@example.com',
'phoneTitle' => 'Phone',
'phoneDescription' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in ero.',
'phone' => '+1 (555) 000-0000',
'addressTitle' => 'Office',
'addressDescription' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in ero.',
'address' => '123 Sample St, Sydney NSW 2000 AU',
'addressHref' => null,
])
@php
$tel = $phone ? 'tel:' . preg_replace('/[^\d+]/', '', $phone) : null;
$directions = $addressHref ?? ($address ? 'https://www.google.com/maps/search/?api=1&query=' . urlencode($address) : null);
@endphp
<section {{ $attributes->merge(['class' => 'w-full bg-background px-[5%] py-16 text-foreground md:py-24 lg:py-28']) }}>
<div class="mx-auto grid max-w-7xl grid-cols-1 gap-12 md:grid-cols-3">
@if ($email)
<div class="flex flex-col items-start gap-5 text-start md:gap-6">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="size-12"
aria-hidden="true">
<rect width="20" height="16" x="2" y="4" rx="2" />
<path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7" />
</svg>
<div class="flex flex-col items-start gap-5 md:gap-6">
<div class="flex flex-col gap-3 md:gap-4">
<h3 class="text-2xl font-bold leading-[1.3] md:text-[2rem]">{{ $emailTitle }}</h3>
@if ($emailDescription)
<p>{{ $emailDescription }}</p>
@endif
</div>
<a href="mailto:{{ $email }}" class="underline underline-offset-4">{{ $email }}</a>
</div>
</div>
@endif
@if ($phone)
<div class="flex flex-col items-start gap-5 text-start md:gap-6">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="size-12"
aria-hidden="true">
<path
d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z" />
</svg>
<div class="flex flex-col items-start gap-5 md:gap-6">
<div class="flex flex-col gap-3 md:gap-4">
<h3 class="text-2xl font-bold leading-[1.3] md:text-[2rem]">{{ $phoneTitle }}</h3>
@if ($phoneDescription)
<p>{{ $phoneDescription }}</p>
@endif
</div>
<a href="{{ $tel }}" class="underline underline-offset-4" dir="ltr">{{ $phone }}</a>
</div>
</div>
@endif
@if ($address)
<div class="flex flex-col items-start gap-5 text-start md:gap-6">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="size-12"
aria-hidden="true">
<path
d="M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0" />
<circle cx="12" cy="10" r="3" />
</svg>
<div class="flex flex-col items-start gap-5 md:gap-6">
<div class="flex flex-col gap-3 md:gap-4">
<h3 class="text-2xl font-bold leading-[1.3] md:text-[2rem]">{{ $addressTitle }}</h3>
@if ($addressDescription)
<p>{{ $addressDescription }}</p>
@endif
</div>
<a href="{{ $directions }}" class="underline underline-offset-4">{{ $address }}</a>
</div>
</div>
@endif
</div>
</section>
Usage
Three left-aligned columns for email, phone and office. Every piece of content is a prop. Set any of email, phone or address to null to hide that column. The address links to a Google Maps search for it unless you pass `address-href`.
<x-ui.blocks.contact-14
email-description="Questions about an order or your account."
email="hello@acme.test"
phone-description="Mon to Fri, 9am to 5pm AEST."
phone="+61 2 5550 0000"
address-description="Come and see the workshop."
address="1 Market St, Sydney NSW 2000"
/>
Props
Every prop with its default. Pass any of them as attributes, using : to bind a PHP value.
@props([
'emailTitle' => 'Email',
'emailDescription' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in ero.',
'email' => 'email@example.com',
'phoneTitle' => 'Phone',
'phoneDescription' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in ero.',
'phone' => '+1 (555) 000-0000',
'addressTitle' => 'Office',
'addressDescription' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in ero.',
'address' => '123 Sample St, Sydney NSW 2000 AU',
'addressHref' => null,
])