التواصل
contact-11
تفاصيل البريد الإلكتروني والهاتف والمكتب مرتبة عموديًا بجانب خريطة كبيرة، مع إمكانية تضمين خريطة ورابط للاتجاهات.
{{--
Email, phone and office details stacked beside a map. Every piece of
content is a prop. No map is embedded by default: the block shows a
placeholder until you pass `map`, an embed URL (Google Maps, OpenStreetMap
and so on), which renders as a lazy-loaded iframe titled `map-title`.
Set any of email, phone or address to null to hide that item. The
directions link defaults to a Google Maps search for the address.
<x-ui.blocks.contact-11
tagline="Visit us"
heading="Contact"
description="Drop in, call or write. We answer within a day."
email="hello@acme.test"
phone="+61 2 5550 0000"
address="1 Market St, Sydney NSW 2000"
map="https://www.openstreetmap.org/export/embed.html?bbox=151.20,-33.87,151.21,-33.86"
map-title="Map of our Sydney office"
/>
--}}
@props([
'tagline' => 'Tagline',
'heading' => 'Contact us',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
'emailTitle' => 'Email',
'emailDescription' => 'Lorem ipsum dolor sit amet.',
'email' => 'email@example.com',
'phoneTitle' => 'Phone',
'phoneDescription' => 'Lorem ipsum dolor sit amet.',
'phone' => '+1 (555) 000-0000',
'addressTitle' => 'Office',
'address' => '123 Sample St, Sydney NSW 2000 AU',
'directionsLabel' => 'Get Directions',
'directionsHref' => null,
'map' => null,
'mapTitle' => 'Map',
])
@php
$tel = $phone ? 'tel:' . preg_replace('/[^\d+]/', '', $phone) : null;
$directions = $directionsHref ?? ($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 flex max-w-7xl flex-col gap-12 md:gap-20">
<div class="flex w-full max-w-3xl flex-col gap-3 md:gap-4">
@if ($tagline)
<p class="font-semibold">{{ $tagline }}</p>
@endif
<div class="flex flex-col gap-5 md:gap-6">
<h2 class="text-4xl font-bold leading-[1.2] md:text-5xl">{{ $heading }}</h2>
@if ($description)
<p class="md:text-lg">{{ $description }}</p>
@endif
</div>
</div>
<div class="flex flex-col gap-12 md:flex-row md:gap-20">
<div class="flex w-full flex-col gap-10 md:max-w-[400px] md:flex-1">
@if ($email)
<div class="flex flex-col gap-3 md:gap-4">
<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-8"
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 gap-2">
<h3 class="text-lg font-bold leading-[1.4] md:text-xl">{{ $emailTitle }}</h3>
@if ($emailDescription)
<p>{{ $emailDescription }}</p>
@endif
<a href="mailto:{{ $email }}" class="self-start underline underline-offset-4">{{ $email }}</a>
</div>
</div>
@endif
@if ($phone)
<div class="flex flex-col gap-3 md:gap-4">
<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-8"
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 gap-2">
<h3 class="text-lg font-bold leading-[1.4] md:text-xl">{{ $phoneTitle }}</h3>
@if ($phoneDescription)
<p>{{ $phoneDescription }}</p>
@endif
<a href="{{ $tel }}" class="self-start underline underline-offset-4" dir="ltr">{{ $phone }}</a>
</div>
</div>
@endif
@if ($address)
<div class="flex flex-col gap-3 md:gap-4">
<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-8"
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 gap-4">
<div class="flex flex-col gap-2">
<h3 class="text-lg font-bold leading-[1.4] md:text-xl">{{ $addressTitle }}</h3>
<address class="not-italic">{{ $address }}</address>
</div>
@if ($directionsLabel && $directions)
<x-ui.button variant="link" href="{{ $directions }}"
class="h-auto self-start p-0 text-base font-normal text-foreground has-[>svg]:px-0">
{{ $directionsLabel }}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round" class="size-5 rtl:rotate-180" aria-hidden="true">
<path d="m9 18 6-6-6-6" />
</svg>
</x-ui.button>
@endif
</div>
</div>
@endif
</div>
<div class="h-[400px] w-full overflow-hidden bg-muted md:h-[516px] md:flex-1">
@if ($map)
<iframe src="{{ $map }}" title="{{ $mapTitle }}" loading="lazy"
referrerpolicy="no-referrer-when-downgrade" class="size-full border-0"></iframe>
@else
<div class="flex size-full items-center justify-center text-muted-foreground" role="img"
aria-label="{{ $mapTitle }}">
<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-16"
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>
@endif
</div>
</div>
</div>
</section>
التثبيت
php artisan ui:add-block contact-11
أمر واحد يثبّت ملف Blade الخاص بالقالب وكل مكوّن يعتمد عليه. اعرضه في تخطيطك كالتالي
<x-ui.blocks.contact-11
/>.
المكونات المضمّنة
1. ثبّت المكونات المطلوبة
php artisan ui:add button
2. حزم خارجية
- composer:
gehrisandro/tailwind-merge-laravel
3.
انسخ كود القالب إلى
resources/views/components/ui/
resources/views/components/ui/blocks/contact-11.blade.php
{{--
Email, phone and office details stacked beside a map. Every piece of
content is a prop. No map is embedded by default: the block shows a
placeholder until you pass `map`, an embed URL (Google Maps, OpenStreetMap
and so on), which renders as a lazy-loaded iframe titled `map-title`.
Set any of email, phone or address to null to hide that item. The
directions link defaults to a Google Maps search for the address.
<x-ui.blocks.contact-11
tagline="Visit us"
heading="Contact"
description="Drop in, call or write. We answer within a day."
email="hello@acme.test"
phone="+61 2 5550 0000"
address="1 Market St, Sydney NSW 2000"
map="https://www.openstreetmap.org/export/embed.html?bbox=151.20,-33.87,151.21,-33.86"
map-title="Map of our Sydney office"
/>
--}}
@props([
'tagline' => 'Tagline',
'heading' => 'Contact us',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
'emailTitle' => 'Email',
'emailDescription' => 'Lorem ipsum dolor sit amet.',
'email' => 'email@example.com',
'phoneTitle' => 'Phone',
'phoneDescription' => 'Lorem ipsum dolor sit amet.',
'phone' => '+1 (555) 000-0000',
'addressTitle' => 'Office',
'address' => '123 Sample St, Sydney NSW 2000 AU',
'directionsLabel' => 'Get Directions',
'directionsHref' => null,
'map' => null,
'mapTitle' => 'Map',
])
@php
$tel = $phone ? 'tel:' . preg_replace('/[^\d+]/', '', $phone) : null;
$directions = $directionsHref ?? ($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 flex max-w-7xl flex-col gap-12 md:gap-20">
<div class="flex w-full max-w-3xl flex-col gap-3 md:gap-4">
@if ($tagline)
<p class="font-semibold">{{ $tagline }}</p>
@endif
<div class="flex flex-col gap-5 md:gap-6">
<h2 class="text-4xl font-bold leading-[1.2] md:text-5xl">{{ $heading }}</h2>
@if ($description)
<p class="md:text-lg">{{ $description }}</p>
@endif
</div>
</div>
<div class="flex flex-col gap-12 md:flex-row md:gap-20">
<div class="flex w-full flex-col gap-10 md:max-w-[400px] md:flex-1">
@if ($email)
<div class="flex flex-col gap-3 md:gap-4">
<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-8"
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 gap-2">
<h3 class="text-lg font-bold leading-[1.4] md:text-xl">{{ $emailTitle }}</h3>
@if ($emailDescription)
<p>{{ $emailDescription }}</p>
@endif
<a href="mailto:{{ $email }}" class="self-start underline underline-offset-4">{{ $email }}</a>
</div>
</div>
@endif
@if ($phone)
<div class="flex flex-col gap-3 md:gap-4">
<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-8"
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 gap-2">
<h3 class="text-lg font-bold leading-[1.4] md:text-xl">{{ $phoneTitle }}</h3>
@if ($phoneDescription)
<p>{{ $phoneDescription }}</p>
@endif
<a href="{{ $tel }}" class="self-start underline underline-offset-4" dir="ltr">{{ $phone }}</a>
</div>
</div>
@endif
@if ($address)
<div class="flex flex-col gap-3 md:gap-4">
<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-8"
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 gap-4">
<div class="flex flex-col gap-2">
<h3 class="text-lg font-bold leading-[1.4] md:text-xl">{{ $addressTitle }}</h3>
<address class="not-italic">{{ $address }}</address>
</div>
@if ($directionsLabel && $directions)
<x-ui.button variant="link" href="{{ $directions }}"
class="h-auto self-start p-0 text-base font-normal text-foreground has-[>svg]:px-0">
{{ $directionsLabel }}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round" class="size-5 rtl:rotate-180" aria-hidden="true">
<path d="m9 18 6-6-6-6" />
</svg>
</x-ui.button>
@endif
</div>
</div>
@endif
</div>
<div class="h-[400px] w-full overflow-hidden bg-muted md:h-[516px] md:flex-1">
@if ($map)
<iframe src="{{ $map }}" title="{{ $mapTitle }}" loading="lazy"
referrerpolicy="no-referrer-when-downgrade" class="size-full border-0"></iframe>
@else
<div class="flex size-full items-center justify-center text-muted-foreground" role="img"
aria-label="{{ $mapTitle }}">
<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-16"
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>
@endif
</div>
</div>
</div>
</section>
الاستخدام
Email, phone and office details stacked beside a map. Every piece of content is a prop. No map is embedded by default: the block shows a placeholder until you pass `map`, an embed URL (Google Maps, OpenStreetMap and so on), which renders as a lazy-loaded iframe titled `map-title`. Set any of email, phone or address to null to hide that item. The directions link defaults to a Google Maps search for the address.
<x-ui.blocks.contact-11
tagline="Visit us"
heading="Contact"
description="Drop in, call or write. We answer within a day."
email="hello@acme.test"
phone="+61 2 5550 0000"
address="1 Market St, Sydney NSW 2000"
map="https://www.openstreetmap.org/export/embed.html?bbox=151.20,-33.87,151.21,-33.86"
map-title="Map of our Sydney office"
/>
الخصائص
كل خاصية مع قيمتها الافتراضية. مرّر أيًّا منها كسمة، واستخدم : لربط قيمة PHP.
@props([
'tagline' => 'Tagline',
'heading' => 'Contact us',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
'emailTitle' => 'Email',
'emailDescription' => 'Lorem ipsum dolor sit amet.',
'email' => 'email@example.com',
'phoneTitle' => 'Phone',
'phoneDescription' => 'Lorem ipsum dolor sit amet.',
'phone' => '+1 (555) 000-0000',
'addressTitle' => 'Office',
'address' => '123 Sample St, Sydney NSW 2000 AU',
'directionsLabel' => 'Get Directions',
'directionsHref' => null,
'map' => null,
'mapTitle' => 'Map',
])