Skip to content
Brok UI

Loading…

No results

Comparison

Open source

Comparison sections — a two-column us-vs-them layout contrasting your product with the alternative, and feature-comparison tables across your own plans or against competitors.

Preview

3 of 5

resources/views/blocks/comparison-checklist.blade.php Blade
@props([
    'eyebrow'    => 'Why Acme',
    'heading'    => 'Everything you need. Nothing you don\'t.',
    'lead'       => 'We built the things that actually matter — and skipped the bloat that slows you down.',
    'ourTitle'   => 'Acme',
    'theirTitle' => 'The others',
    'ctaLabel'   => 'Start for free',
    'ctaHref'    => '#',
    'rows'       => null,
])

@php
    $rows ??= [
        ['label' => 'Unlimited team members', 'us' => true, 'them' => false],
        ['label' => 'Real-time collaboration', 'us' => true, 'them' => false],
        ['label' => 'One-click integrations', 'us' => true, 'them' => true],
        ['label' => '24/7 priority support', 'us' => true, 'them' => false],
        ['label' => 'Built-in audit trail', 'us' => true, 'them' => false],
        ['label' => 'Custom domain & SSO', 'us' => true, 'them' => true],
        ['label' => 'Transparent flat pricing', 'us' => true, 'them' => false],
    ];
    $usCount = collect($rows)->where('us', true)->count();
    $themCount = collect($rows)->where('them', true)->count();
    $total = count($rows);
@endphp

<x-ui.section data-slot="comparison-checklist" aria-labelledby="cc01-heading" space="xl" {{ $attributes }}>
    <div class="mx-auto max-w-3xl px-4">
        <div class="mx-auto mb-10 max-w-xl text-center">
            @if ($eyebrow)<p class="mb-4 text-sm font-semibold uppercase tracking-widest text-primary">{{ __($eyebrow) }}</p>@endif
            <h2 id="cc01-heading" class="text-balance text-3xl font-bold tracking-tight sm:text-4xl">{{ __($heading) }}</h2>
            @if ($lead)<p class="mt-4 text-pretty text-base text-muted-foreground sm:text-lg">{{ __($lead) }}</p>@endif
        </div>

        <x-ui.card class="overflow-hidden">
            <div class="grid grid-cols-[1fr_6rem_6rem] items-end gap-x-4 border-b border-border bg-muted/40 px-6 py-4">
                <span class="text-sm font-semibold uppercase tracking-wide text-muted-foreground">{{ __('Feature') }}</span>
                <div class="flex flex-col items-center gap-2 text-center">
                    <span class="text-sm font-bold text-foreground">{{ __($ourTitle) }}</span>
                    <x-ui.badge variant="default" size="sm">{{ __('Best') }}</x-ui.badge>
                </div>
                <div class="text-center"><span class="text-sm font-semibold text-muted-foreground">{{ __($theirTitle) }}</span></div>
            </div>

            <ul role="list" class="divide-y divide-border">
                @foreach ($rows as $row)
                    <li class="grid grid-cols-[1fr_6rem_6rem] items-center gap-x-4 px-6 py-4">
                        <span class="text-sm font-medium text-foreground">{{ __($row['label']) }}</span>
                        <div class="flex justify-center">
                            @if ($row['us'])
                                <span class="flex size-7 items-center justify-center rounded-full bg-primary/10" role="img" aria-label="{{ __('Yes') }}">
                                    <svg class="size-4 text-primary" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 8l3.5 3.5L13 4.5" /></svg>
                                </span>
                            @else
                                <span class="text-muted-foreground" role="img" aria-label="{{ __('No') }}"><svg class="size-4" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M3 8h10" /></svg></span>
                            @endif
                        </div>
                        <div class="flex justify-center text-muted-foreground">
                            @if ($row['them'])
                                <span role="img" aria-label="{{ __('Yes') }}"><svg class="size-4" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 8l3.5 3.5L13 4.5" /></svg></span>
                            @else
                                <span role="img" aria-label="{{ __('No') }}"><svg class="size-4" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M4 4l8 8M12 4l-8 8" /></svg></span>
                            @endif
                        </div>
                    </li>
                @endforeach
                <li class="grid grid-cols-[1fr_6rem_6rem] items-center gap-x-4 bg-muted/30 px-6 py-4" aria-label="{{ __('Score summary') }}">
                    <span class="text-sm font-semibold text-foreground">{{ __('Score') }}</span>
                    <div class="flex justify-center"><x-ui.badge variant="default">{{ $usCount }}/{{ $total }}</x-ui.badge></div>
                    <div class="flex justify-center"><x-ui.badge variant="secondary">{{ $themCount }}/{{ $total }}</x-ui.badge></div>
                </li>
            </ul>

            <div class="flex justify-center border-t border-border bg-muted/20 py-6">
                <x-ui.button variant="default" :href="$ctaHref" :with-arrow="true">{{ __($ctaLabel) }}</x-ui.button>
            </div>
        </x-ui.card>
    </div>
</x-ui.section>

Installation

terminal
php artisan ui:add blocks/comparison-checklist

Installs these dependencies automatically:

Registry contract

Install confidence

php artisan ui:add blocks/comparison-checklist 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/comparison-checklist.blade.php

Registry dependencies

badge button card section

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.

comparison-checklist.md
# Brok UI block: Comparison Checklist (`comparison-checklist`)

A single-card two-column comparison checklist contrasting your product with the alternative, with a score summary and call-to-action.

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/comparison-checklist
```

## Render it

```blade
<x-blocks.comparison-checklist />
```

## Props

- `eyebrow` (string, default `Why Acme`)
- `heading` (string, default `Everything you need. Nothing you don\'t.`)
- `lead` (string, default `We built the things that actually matter — and skipped the bloat that slows you down.`)
- `our-title` (string, default `Acme`)
- `their-title` (string, default `The others`)
- `cta-label` (string, default `Start for free`)
- `cta-href` (string, default `#`)
- `rows` (mixed|null, default `null`)

## Use when

- Contrasting your product with one named alternative in a single two-column checklist card with a score summary and CTA.
- Counting how many rows favour you and surfacing that as a running score above the CTA.

## Avoid when

- Use comparison-competitor-table for a full multi-competitor table, or comparison-versus for a two-card layout without a shared checklist.

## Rules

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

  • Contrasting your product with one named alternative in a single two-column checklist card with a score summary and CTA.
  • Counting how many rows favour you and surfacing that as a running score above the CTA.

Avoid when

  • Use comparison-competitor-table for a full multi-competitor table, or comparison-versus for a two-card layout without a shared checklist.

Anti-patterns

  • Do not replace semantic props with conflicting utility classes.
  • Do not remove labels, focus styles, or state attributes.
Anatomy
root comparison-checklist

Usage

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

resources/views/welcome.blade.php Blade
<x-blocks.comparison-checklist />

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/comparison-checklist.blade.php Blade
@props([
    'eyebrow'    => 'Why Acme',
    'heading'    => 'Everything you need. Nothing you don\'t.',
    'lead'       => 'We built the things that actually matter — and skipped the bloat that slows you down.',
    'ourTitle'   => 'Acme',
    'theirTitle' => 'The others',
    'ctaLabel'   => 'Start for free',
    'ctaHref'    => '#',
    'rows'       => null,
])

@php
    $rows ??= [
        ['label' => 'Unlimited team members', 'us' => true, 'them' => false],
        ['label' => 'Real-time collaboration', 'us' => true, 'them' => false],
        ['label' => 'One-click integrations', 'us' => true, 'them' => true],
        ['label' => '24/7 priority support', 'us' => true, 'them' => false],
        ['label' => 'Built-in audit trail', 'us' => true, 'them' => false],
        ['label' => 'Custom domain & SSO', 'us' => true, 'them' => true],
        ['label' => 'Transparent flat pricing', 'us' => true, 'them' => false],
    ];
    $usCount = collect($rows)->where('us', true)->count();
    $themCount = collect($rows)->where('them', true)->count();
    $total = count($rows);
@endphp

<x-ui.section data-slot="comparison-checklist" aria-labelledby="cc01-heading" space="xl" {{ $attributes }}>
    <div class="mx-auto max-w-3xl px-4">
        <div class="mx-auto mb-10 max-w-xl text-center">
            @if ($eyebrow)<p class="mb-4 text-sm font-semibold uppercase tracking-widest text-primary">{{ __($eyebrow) }}</p>@endif
            <h2 id="cc01-heading" class="text-balance text-3xl font-bold tracking-tight sm:text-4xl">{{ __($heading) }}</h2>
            @if ($lead)<p class="mt-4 text-pretty text-base text-muted-foreground sm:text-lg">{{ __($lead) }}</p>@endif
        </div>

        <x-ui.card class="overflow-hidden">
            <div class="grid grid-cols-[1fr_6rem_6rem] items-end gap-x-4 border-b border-border bg-muted/40 px-6 py-4">
                <span class="text-sm font-semibold uppercase tracking-wide text-muted-foreground">{{ __('Feature') }}</span>
                <div class="flex flex-col items-center gap-2 text-center">
                    <span class="text-sm font-bold text-foreground">{{ __($ourTitle) }}</span>
                    <x-ui.badge variant="default" size="sm">{{ __('Best') }}</x-ui.badge>
                </div>
                <div class="text-center"><span class="text-sm font-semibold text-muted-foreground">{{ __($theirTitle) }}</span></div>
            </div>

            <ul role="list" class="divide-y divide-border">
                @foreach ($rows as $row)
                    <li class="grid grid-cols-[1fr_6rem_6rem] items-center gap-x-4 px-6 py-4">
                        <span class="text-sm font-medium text-foreground">{{ __($row['label']) }}</span>
                        <div class="flex justify-center">
                            @if ($row['us'])
                                <span class="flex size-7 items-center justify-center rounded-full bg-primary/10" role="img" aria-label="{{ __('Yes') }}">
                                    <svg class="size-4 text-primary" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 8l3.5 3.5L13 4.5" /></svg>
                                </span>
                            @else
                                <span class="text-muted-foreground" role="img" aria-label="{{ __('No') }}"><svg class="size-4" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M3 8h10" /></svg></span>
                            @endif
                        </div>
                        <div class="flex justify-center text-muted-foreground">
                            @if ($row['them'])
                                <span role="img" aria-label="{{ __('Yes') }}"><svg class="size-4" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 8l3.5 3.5L13 4.5" /></svg></span>
                            @else
                                <span role="img" aria-label="{{ __('No') }}"><svg class="size-4" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M4 4l8 8M12 4l-8 8" /></svg></span>
                            @endif
                        </div>
                    </li>
                @endforeach
                <li class="grid grid-cols-[1fr_6rem_6rem] items-center gap-x-4 bg-muted/30 px-6 py-4" aria-label="{{ __('Score summary') }}">
                    <span class="text-sm font-semibold text-foreground">{{ __('Score') }}</span>
                    <div class="flex justify-center"><x-ui.badge variant="default">{{ $usCount }}/{{ $total }}</x-ui.badge></div>
                    <div class="flex justify-center"><x-ui.badge variant="secondary">{{ $themCount }}/{{ $total }}</x-ui.badge></div>
                </li>
            </ul>

            <div class="flex justify-center border-t border-border bg-muted/20 py-6">
                <x-ui.button variant="default" :href="$ctaHref" :with-arrow="true">{{ __($ctaLabel) }}</x-ui.button>
            </div>
        </x-ui.card>
    </div>
</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