Skip to content
Brok UI

Loading…

No results

Contact

Open source

Contact sections — a split info+form (with optional icon tiles and socials), method cards, a map pairing and a compact strip.

Preview

2 of 5

resources/views/blocks/contact-cards.blade.php Blade
@props([
    'eyebrow' => 'Contact',
    'heading' => 'Get in touch with our team',
    'subheading' => "Choose the channel that suits you best — we're here to help and usually reply within one business day.",
    'methods' => null,
])

@php
    $methods ??= [
        [
            'icon' => 'mail',
            'title' => 'Email us',
            'detail' => 'hello@example.com',
            'action' => 'Send an email',
            'href' => 'mailto:hello@example.com',
        ],
        [
            'icon' => 'phone',
            'title' => 'Call us',
            'detail' => '+1 (555) 000-0000',
            'action' => 'Call now',
            'href' => 'tel:+15550000000',
        ],
        [
            'icon' => 'pin',
            'title' => 'Visit us',
            'detail' => '100 Market St, Suite 200, San Francisco',
            'action' => 'Get directions',
            'href' => '#',
        ],
        [
            'icon' => 'chat',
            'title' => 'Live chat',
            'detail' => 'Available Mon–Fri, 9am to 6pm',
            'action' => 'Start a chat',
            'href' => '#',
        ],
    ];
@endphp

<x-ui.section space="xl" {{ $attributes }}>
    <x-ui.container gutter="sm">
        <x-ui.section-heading align="center" overline-style="label" :overline="$eyebrow" :title="$heading" :subtitle="$subheading" />

        <div class="mt-12 grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-4">
            @foreach ($methods as $method)
                <x-ui.card class="flex h-full flex-col text-center transition-shadow hover:shadow-md">
                    <x-ui.card.content class="flex flex-1 flex-col items-center pt-6">
                        <span class="flex size-12 items-center justify-center rounded-md border border-border bg-muted text-primary" aria-hidden="true">
                            @switch($method['icon'])
                                @case('mail')
                                    <svg xmlns="http://www.w3.org/2000/svg" class="size-6" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
                                        <rect x="2" y="4" width="20" height="16" rx="2" />
                                        <path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7" />
                                    </svg>
                                    @break
                                @case('phone')
                                    <svg xmlns="http://www.w3.org/2000/svg" class="size-6" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
                                        <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>
                                    @break
                                @case('pin')
                                    <svg xmlns="http://www.w3.org/2000/svg" class="size-6" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
                                        <path d="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z" />
                                        <circle cx="12" cy="10" r="3" />
                                    </svg>
                                    @break
                                @case('chat')
                                    <svg xmlns="http://www.w3.org/2000/svg" class="size-6" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
                                        <path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z" />
                                    </svg>
                                    @break
                            @endswitch
                        </span>

                        <h3 class="mt-6 text-lg font-semibold">{{ __($method['title']) }}</h3>
                        <p class="mt-2 text-sm text-muted-foreground">{{ __($method['detail']) }}</p>

                        <x-ui.button :href="$method['href']" variant="link" class="gap-2 mt-auto pt-4">
                            {{ __($method['action']) }}
                            <svg xmlns="http://www.w3.org/2000/svg" class="size-4 rtl:-scale-x-100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
                                <path d="M5 12h14" />
                                <path d="m12 5 7 7-7 7" />
                            </svg>
                        </x-ui.button>
                    </x-ui.card.content>
                </x-ui.card>
            @endforeach
        </div>
    </x-ui.container>
</x-ui.section>

Installation

terminal
php artisan ui:add blocks/contact-cards

Installs these dependencies automatically:

Registry contract

Install confidence

php artisan ui:add blocks/contact-cards writes only the generated targets below. The CLI validates each file hash before writing and prompts before replacing local changes unless --force is used.

Version
1.0.5
License
open
Stability
stable
Contract
v1
Foundation
≥ 1.0.0
Type Generated target
blade resources/views/blocks/contact-cards.blade.php

Registry dependencies

button card container section section-heading

Package dependencies

composer: jml/brok:^0.2

Use with AI

A brief for your coding agent: what the block is, the install command, how to render it, its props and the rules. Copy it, or open a prompt about this block in an assistant.

contact-cards.md
# Brok UI block: Contact Cards (`contact-cards`)

A centered heading and intro above a responsive grid of contact-method cards, each with an icon tile, title, muted detail line, and a link-style action button.

Brok UI is a Laravel Blade registry. `ui:add` copies this block into the app as plain Blade the app owns; it composes installed `<brok:*>` primitives and semantic design tokens.

## Install

```bash
php artisan ui:add blocks/contact-cards
```

## Render it

```blade
<x-blocks.contact-cards />
```

## Props

- `eyebrow` (string, default `Contact`)
- `heading` (string, default `Get in touch with our team`)
- `subheading` (string, default `Choose the channel that suits you best — we're here to help and usually reply within one business day.`)
- `methods` (mixed|null, default `null`)

## Use when

- Presenting several contact methods (email, phone, chat) as a grid of icon-tile cards, each with its own action link.
- Skipping a form entirely in favour of direct links out to each channel.

## Avoid when

- Use contact-split or contact-editorial if the page needs an actual contact form rather than a set of outbound links.

## Rules

- Render the installed block with `<x-blocks.contact-cards />` and pass data through its props; edit the copied file only for structural changes.
- Keep the semantic design tokens (`bg-background`, `text-muted-foreground`); never swap in raw colour utilities.
- Keep the `data-slot` attributes and the logical (start/end) spacing so the markup still mirrors under `dir="rtl"`.

## Links

- Docs: https://brokui.dev/blocks/contact-cards
- Registry JSON (files, props, contract): https://brokui.dev/r/open/blocks/contact-cards.json

Working in Claude Code, Cursor or Codex? Give the agent the whole registry through the MCP server or the Brok UI skill.

Guidance

Use when

  • Presenting several contact methods (email, phone, chat) as a grid of icon-tile cards, each with its own action link.
  • Skipping a form entirely in favour of direct links out to each channel.

Avoid when

  • Use contact-split or contact-editorial if the page needs an actual contact form rather than a set of outbound links.

Anti-patterns

  • Do not replace semantic props with conflicting utility classes.
  • Do not remove labels, focus styles, or state attributes.

Usage

Render the block as a component, passing data where useful:

resources/views/welcome.blade.php Blade
<x-blocks.contact-cards />

Built from primitives

Composes <brok:*> Semantic tokens Re-themeable RTL-ready

This block composes installed <brok:*> primitives and semantic design tokens only — it does not reimplement any primitive. Re-theme it (light, dark, admin, customer) by editing CSS variables; flip the preview to RTL to confirm it mirrors.

Source

The exact, editable file ui:add writes into your app. The preview above renders this same source — there are no preview-only blocks.

resources/views/blocks/contact-cards.blade.php Blade
@props([
    'eyebrow' => 'Contact',
    'heading' => 'Get in touch with our team',
    'subheading' => "Choose the channel that suits you best — we're here to help and usually reply within one business day.",
    'methods' => null,
])

@php
    $methods ??= [
        [
            'icon' => 'mail',
            'title' => 'Email us',
            'detail' => 'hello@example.com',
            'action' => 'Send an email',
            'href' => 'mailto:hello@example.com',
        ],
        [
            'icon' => 'phone',
            'title' => 'Call us',
            'detail' => '+1 (555) 000-0000',
            'action' => 'Call now',
            'href' => 'tel:+15550000000',
        ],
        [
            'icon' => 'pin',
            'title' => 'Visit us',
            'detail' => '100 Market St, Suite 200, San Francisco',
            'action' => 'Get directions',
            'href' => '#',
        ],
        [
            'icon' => 'chat',
            'title' => 'Live chat',
            'detail' => 'Available Mon–Fri, 9am to 6pm',
            'action' => 'Start a chat',
            'href' => '#',
        ],
    ];
@endphp

<x-ui.section space="xl" {{ $attributes }}>
    <x-ui.container gutter="sm">
        <x-ui.section-heading align="center" overline-style="label" :overline="$eyebrow" :title="$heading" :subtitle="$subheading" />

        <div class="mt-12 grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-4">
            @foreach ($methods as $method)
                <x-ui.card class="flex h-full flex-col text-center transition-shadow hover:shadow-md">
                    <x-ui.card.content class="flex flex-1 flex-col items-center pt-6">
                        <span class="flex size-12 items-center justify-center rounded-md border border-border bg-muted text-primary" aria-hidden="true">
                            @switch($method['icon'])
                                @case('mail')
                                    <svg xmlns="http://www.w3.org/2000/svg" class="size-6" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
                                        <rect x="2" y="4" width="20" height="16" rx="2" />
                                        <path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7" />
                                    </svg>
                                    @break
                                @case('phone')
                                    <svg xmlns="http://www.w3.org/2000/svg" class="size-6" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
                                        <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>
                                    @break
                                @case('pin')
                                    <svg xmlns="http://www.w3.org/2000/svg" class="size-6" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
                                        <path d="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z" />
                                        <circle cx="12" cy="10" r="3" />
                                    </svg>
                                    @break
                                @case('chat')
                                    <svg xmlns="http://www.w3.org/2000/svg" class="size-6" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
                                        <path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z" />
                                    </svg>
                                    @break
                            @endswitch
                        </span>

                        <h3 class="mt-6 text-lg font-semibold">{{ __($method['title']) }}</h3>
                        <p class="mt-2 text-sm text-muted-foreground">{{ __($method['detail']) }}</p>

                        <x-ui.button :href="$method['href']" variant="link" class="gap-2 mt-auto pt-4">
                            {{ __($method['action']) }}
                            <svg xmlns="http://www.w3.org/2000/svg" class="size-4 rtl:-scale-x-100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
                                <path d="M5 12h14" />
                                <path d="m12 5 7 7-7 7" />
                            </svg>
                        </x-ui.button>
                    </x-ui.card.content>
                </x-ui.card>
            @endforeach
        </div>
    </x-ui.container>
</x-ui.section>

Ownership & lifecycle

Owner, release state, review evidence and adoption for this item.
Owner
Platform UI (@JoshJML)
Current version
1.0.5
Status
Stable
License
open
Deprecation
Not deprecated
Contract
v1
Foundation
≥ 1.0.0