Skip to content
Brok UI

Loading…

No results

OG Image

Open source

Open Graph social-card templates (1200×630) — minimal, editorial, product, profile, stat, quote and more — token-themed and ready to screenshot in an OG route.

Preview

7 of 16

resources/views/blocks/og-image-product.blade.php Blade
@props([
    'brand' => 'ogimagecn',
    'title' => 'The token-themed OG card kit',
    'description' => 'Copy-into-your-app Open Graph templates that follow your brand and theme out of the box.',
    'price' => '$0',
    'image' => null,
    'logo' => null,
])

{{--
    Open Graph card — "Product". A dark two-column 1200×630 social card: a left column
    with brand mark, title, description and a price pill, and a right column with a
    product image panel. Adapted from ogimagecn.com to our system: the indigo accent
    maps to the `primary` token, the price pill is a default badge, and the image panel
    falls back to a token gradient when no image is supplied. Render it inside a
    1200×630 viewport in your OG image route (e.g. a Browsershot screenshot) for
    pixel-accurate social cards.
--}}
<figure
    data-slot="og-image"
    data-variant="product"
    {{ $attributes->merge(['class' => 'relative isolate flex aspect-[1200/630] w-full flex-col gap-8 overflow-hidden rounded-lg border border-border bg-background p-8 text-foreground sm:flex-row sm:p-12 lg:p-16']) }}
>
    <figcaption class="flex flex-1 flex-col justify-between gap-8">
        <div class="flex items-center gap-4">
            @if ($logo)
                <img src="{{ $logo }}" alt="" class="size-8 rounded-md object-contain sm:size-10" />
            @else
                <span class="size-8 rounded-md bg-primary sm:size-10" aria-hidden="true"></span>
            @endif
            <span class="text-lg font-semibold sm:text-2xl">{{ __($brand) }}</span>
        </div>

        <div class="flex flex-col">
            <p class="max-w-xl text-balance text-2xl font-bold leading-[1.05] tracking-tight sm:text-4xl lg:text-6xl">{{ __($title) }}</p>
            <p class="mt-4 max-w-md text-pretty text-sm leading-relaxed text-muted-foreground sm:mt-6 sm:text-lg lg:text-2xl">{{ __($description) }}</p>
        </div>

        <div class="flex">
            <x-ui.badge variant="default" class="text-sm sm:text-xl">{{ __($price) }}</x-ui.badge>
        </div>
    </figcaption>

    <div class="relative aspect-square w-full overflow-hidden rounded-lg border border-border sm:aspect-auto sm:w-2/5 lg:w-[40%]">
        @if ($image)
            <img src="{{ $image }}" alt="" class="absolute inset-0 size-full object-cover" />
        @else
            <div aria-hidden="true" class="absolute inset-0 size-full bg-gradient-to-br from-primary to-primary/40"></div>
        @endif
    </div>
</figure>

Installation

terminal
php artisan ui:add blocks/og-image-product

Installs these dependencies automatically:

Registry contract

Install confidence

php artisan ui:add blocks/og-image-product 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.3
License
open
Stability
stable
Contract
v1
Foundation
≥ 1.0.0
Type Generated target
blade resources/views/blocks/og-image-product.blade.php

Registry dependencies

badge

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.

og-image-product.md
# Brok UI block: OG Product (`og-image-product`)

A dark two-column product Open Graph card with a brand mark, title, description, a price pill badge and a product image panel.

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/og-image-product
```

## Render it

```blade
<x-blocks.og-image-product />
```

## Props

- `brand` (string, default `ogimagecn`) — Brand wordmark shown next to the logo mark.
- `title` (string, default `The token-themed OG card kit`) — Large product headline.
- `description` (string, default `Copy-into-your-app Open Graph templates that follow your brand and theme out of the box.`) — Supporting copy under the title.
- `price` (string, default `$0`) — Price shown inside the pill badge.
- `image` (mixed|null, default `null`) — Product image URL for the right-hand panel; falls back to a token gradient when null.
- `logo` (mixed|null, default `null`) — Optional logo image URL; falls back to a solid token square when null.

## Use when

- Use for a dark two-column product card pairing brand, title, description and a price pill on the left with a product image panel on the right.
- Suited to pricing pages or product launches where showing a price and product shot alongside copy matters.

## Avoid when

- Avoid when there is no product image or price to show; use og-image-simple (simple) or og-image-logo (logo) instead.

## Rules

- Render the installed block with `<x-blocks.og-image-product />` 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/og-image-product
- Registry JSON (files, props, contract): https://brokui.dev/r/open/blocks/og-image-product.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

  • Use for a dark two-column product card pairing brand, title, description and a price pill on the left with a product image panel on the right.
  • Suited to pricing pages or product launches where showing a price and product shot alongside copy matters.

Avoid when

  • Avoid when there is no product image or price to show; use og-image-simple (simple) or og-image-logo (logo) instead.

Anti-patterns

  • Do not replace semantic props with conflicting utility classes.
  • Do not remove labels, focus styles, or state attributes.
Anatomy
figure root brand mark title description price badge product image panel

Usage

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

resources/views/welcome.blade.php Blade
<x-blocks.og-image-product />

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/og-image-product.blade.php Blade
@props([
    'brand' => 'ogimagecn',
    'title' => 'The token-themed OG card kit',
    'description' => 'Copy-into-your-app Open Graph templates that follow your brand and theme out of the box.',
    'price' => '$0',
    'image' => null,
    'logo' => null,
])

{{--
    Open Graph card — "Product". A dark two-column 1200×630 social card: a left column
    with brand mark, title, description and a price pill, and a right column with a
    product image panel. Adapted from ogimagecn.com to our system: the indigo accent
    maps to the `primary` token, the price pill is a default badge, and the image panel
    falls back to a token gradient when no image is supplied. Render it inside a
    1200×630 viewport in your OG image route (e.g. a Browsershot screenshot) for
    pixel-accurate social cards.
--}}
<figure
    data-slot="og-image"
    data-variant="product"
    {{ $attributes->merge(['class' => 'relative isolate flex aspect-[1200/630] w-full flex-col gap-8 overflow-hidden rounded-lg border border-border bg-background p-8 text-foreground sm:flex-row sm:p-12 lg:p-16']) }}
>
    <figcaption class="flex flex-1 flex-col justify-between gap-8">
        <div class="flex items-center gap-4">
            @if ($logo)
                <img src="{{ $logo }}" alt="" class="size-8 rounded-md object-contain sm:size-10" />
            @else
                <span class="size-8 rounded-md bg-primary sm:size-10" aria-hidden="true"></span>
            @endif
            <span class="text-lg font-semibold sm:text-2xl">{{ __($brand) }}</span>
        </div>

        <div class="flex flex-col">
            <p class="max-w-xl text-balance text-2xl font-bold leading-[1.05] tracking-tight sm:text-4xl lg:text-6xl">{{ __($title) }}</p>
            <p class="mt-4 max-w-md text-pretty text-sm leading-relaxed text-muted-foreground sm:mt-6 sm:text-lg lg:text-2xl">{{ __($description) }}</p>
        </div>

        <div class="flex">
            <x-ui.badge variant="default" class="text-sm sm:text-xl">{{ __($price) }}</x-ui.badge>
        </div>
    </figcaption>

    <div class="relative aspect-square w-full overflow-hidden rounded-lg border border-border sm:aspect-auto sm:w-2/5 lg:w-[40%]">
        @if ($image)
            <img src="{{ $image }}" alt="" class="absolute inset-0 size-full object-cover" />
        @else
            <div aria-hidden="true" class="absolute inset-0 size-full bg-gradient-to-br from-primary to-primary/40"></div>
        @endif
    </div>
</figure>

Ownership & lifecycle

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