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

10 of 16

resources/views/blocks/og-image-stat.blade.php Blade
@props([
    'label' => 'Monthly active users',
    'value' => '128K',
    'caption' => 'Up and to the right since launch, with no signs of slowing down.',
    'trend' => '+24%',
    'brand' => 'ogimagecn',
    'logo' => null,
])

{{--
    Open Graph card — "Stat". A dark 1200×630 metric card: an uppercase label, an
    oversized value with an optional trend pill, a caption, and a bottom brand
    mark. Adapted from ogimagecn.com to our system — the green accent maps to the
    `success` token, the radial glow becomes a blurred token overlay, and the card
    follows the active theme. 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="stat"
    {{ $attributes->merge(['class' => 'relative isolate flex aspect-[1200/630] w-full flex-col justify-center overflow-hidden rounded-lg border border-border bg-background p-8 text-foreground sm:p-12 lg:p-24']) }}
>
    {{-- Green accent glow rising from the bottom-center edge (decorative). --}}
    <div aria-hidden="true" class="pointer-events-none absolute inset-x-0 -bottom-1/3 -z-10 mx-auto h-2/3 w-2/3 rounded-full bg-success/20 blur-3xl"></div>

    <figcaption>
        <p class="text-xs font-semibold uppercase tracking-wide text-muted-foreground sm:text-base lg:text-2xl">{{ __($label) }}</p>

        <div class="mt-4 flex items-end gap-4 sm:mt-6 sm:gap-6">
            <span class="text-6xl font-bold leading-none tracking-tight sm:text-8xl lg:text-[9rem]">{{ __($value) }}</span>
            @if ($trend)
                <x-ui.badge variant="success" class="mb-2 sm:mb-4 lg:mb-8">
                    <svg class="size-4 text-success sm:size-5" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24" aria-hidden="true">
                        <path d="M7 17 17 7M9 7h8v8" />
                    </svg>
                    {{ __($trend) }}
                </x-ui.badge>
            @endif
        </div>

        <p class="mt-6 max-w-2xl text-pretty text-sm leading-relaxed text-muted-foreground sm:mt-8 sm:text-lg lg:text-2xl">{{ __($caption) }}</p>
    </figcaption>

    <div class="absolute bottom-8 flex items-center gap-4 text-sm font-semibold text-muted-foreground sm:bottom-12 sm:text-base lg:text-xl">
        @if ($logo)
            <img src="{{ $logo }}" alt="" class="size-6 rounded-md object-contain sm:size-7" />
        @else
            <span class="size-6 rounded-md bg-success sm:size-7" aria-hidden="true"></span>
        @endif
        {{ __($brand) }}
    </div>
</figure>

Installation

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

Installs these dependencies automatically:

Registry contract

Install confidence

php artisan ui:add blocks/og-image-stat 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-stat.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-stat.md
# Brok UI block: OG Stat (`og-image-stat`)

A dark Open Graph metric card with an uppercase label, an oversized value, an optional trend pill, a caption and a brand mark.

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

## Render it

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

## Props

- `label` (string, default `Monthly active users`) — Uppercase label above the value.
- `value` (string, default `128K`) — The oversized metric value.
- `caption` (string, default `Up and to the right since launch, with no signs of slowing down.`) — Supporting copy under the value.
- `trend` (string, default `+24%`) — Trend badge shown beside the value; falsy hides it.
- `brand` (string, default `ogimagecn`) — Brand wordmark shown next to the logo mark.
- `logo` (mixed|null, default `null`) — Optional logo image URL; falls back to a solid token square when null.

## Use when

- Use for a dark metric or stat card built around one oversized value with an uppercase label, an optional trend pill and a caption.
- Suited to sharing a single key number, such as growth, users or revenue, rather than a headline or list of highlights.

## Avoid when

- Avoid when there is no single metric to headline, or multiple release items need listing; use og-image-changelog (changelog) or og-image-simple (simple) instead.

## Rules

- Render the installed block with `<x-blocks.og-image-stat />` 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-stat
- Registry JSON (files, props, contract): https://brokui.dev/r/open/blocks/og-image-stat.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 metric or stat card built around one oversized value with an uppercase label, an optional trend pill and a caption.
  • Suited to sharing a single key number, such as growth, users or revenue, rather than a headline or list of highlights.

Avoid when

  • Avoid when there is no single metric to headline, or multiple release items need listing; use og-image-changelog (changelog) or og-image-simple (simple) instead.

Anti-patterns

  • Do not replace semantic props with conflicting utility classes.
  • Do not remove labels, focus styles, or state attributes.
Anatomy
figure root accent glow label value trend badge caption brand mark

Usage

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

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

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-stat.blade.php Blade
@props([
    'label' => 'Monthly active users',
    'value' => '128K',
    'caption' => 'Up and to the right since launch, with no signs of slowing down.',
    'trend' => '+24%',
    'brand' => 'ogimagecn',
    'logo' => null,
])

{{--
    Open Graph card — "Stat". A dark 1200×630 metric card: an uppercase label, an
    oversized value with an optional trend pill, a caption, and a bottom brand
    mark. Adapted from ogimagecn.com to our system — the green accent maps to the
    `success` token, the radial glow becomes a blurred token overlay, and the card
    follows the active theme. 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="stat"
    {{ $attributes->merge(['class' => 'relative isolate flex aspect-[1200/630] w-full flex-col justify-center overflow-hidden rounded-lg border border-border bg-background p-8 text-foreground sm:p-12 lg:p-24']) }}
>
    {{-- Green accent glow rising from the bottom-center edge (decorative). --}}
    <div aria-hidden="true" class="pointer-events-none absolute inset-x-0 -bottom-1/3 -z-10 mx-auto h-2/3 w-2/3 rounded-full bg-success/20 blur-3xl"></div>

    <figcaption>
        <p class="text-xs font-semibold uppercase tracking-wide text-muted-foreground sm:text-base lg:text-2xl">{{ __($label) }}</p>

        <div class="mt-4 flex items-end gap-4 sm:mt-6 sm:gap-6">
            <span class="text-6xl font-bold leading-none tracking-tight sm:text-8xl lg:text-[9rem]">{{ __($value) }}</span>
            @if ($trend)
                <x-ui.badge variant="success" class="mb-2 sm:mb-4 lg:mb-8">
                    <svg class="size-4 text-success sm:size-5" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24" aria-hidden="true">
                        <path d="M7 17 17 7M9 7h8v8" />
                    </svg>
                    {{ __($trend) }}
                </x-ui.badge>
            @endif
        </div>

        <p class="mt-6 max-w-2xl text-pretty text-sm leading-relaxed text-muted-foreground sm:mt-8 sm:text-lg lg:text-2xl">{{ __($caption) }}</p>
    </figcaption>

    <div class="absolute bottom-8 flex items-center gap-4 text-sm font-semibold text-muted-foreground sm:bottom-12 sm:text-base lg:text-xl">
        @if ($logo)
            <img src="{{ $logo }}" alt="" class="size-6 rounded-md object-contain sm:size-7" />
        @else
            <span class="size-6 rounded-md bg-success sm:size-7" aria-hidden="true"></span>
        @endif
        {{ __($brand) }}
    </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