Skip to content
Brok UI

Loading…

No results

Pricing

Open source

Pricing sections — from a simple three-tier table (with an optional billing-period toggle) to gradient and elevated cards, tinted and horizontal layouts, and a tabbed switcher.

Preview

8 of 10

resources/views/blocks/pricing-horizontal.blade.php Blade
@props([
    'heading' => 'Organize without limits',
    'subheading' => 'Local or cloud — your choice.',
    'plans' => null,
])

@php
    // Fixed token-gradient map — whole class strings picked by key. Never splice a
    // variable into an arbitrary class (JIT can't see it); never raw colour.
    $accents = [
        'primary' => 'from-primary to-accent',
        'secondary' => 'from-secondary to-primary',
        'muted' => 'from-muted to-accent',
    ];
    $defaultAccent = 'primary';

    // Fixed icon map keyed by accent — decorative, currentColor, token-coloured text.
    $icons = [
        'primary' => 'M3.75 3.75h16.5v16.5H3.75zM8.25 8.25h7.5v7.5h-7.5z',
        'secondary' => 'M12 2.25 2.25 7.5 12 12.75 21.75 7.5 12 2.25zM2.25 12 12 17.25 21.75 12M2.25 16.5 12 21.75 21.75 16.5',
        'muted' => 'M12 21.75a9.75 9.75 0 1 0 0-19.5 9.75 9.75 0 0 0 0 19.5zM12 6v6l4.5 2.25',
    ];

    $plans ??= [
        [
            'name' => 'Local',
            'accent' => 'muted',
            'recommended' => false,
            'features' => [
                'Unlimited boards on your machine',
                'Offline-first, zero latency',
                'Export anytime, you own the data',
            ],
            'price' => '$0',
            'period' => '/forever',
            'originalPrice' => null,
            'cta' => 'Download free',
            'href' => '#',
        ],
        [
            'name' => 'Cloud',
            'accent' => 'primary',
            'recommended' => true,
            'features' => [
                'Real-time sync across devices',
                'Team workspaces & sharing',
                'Versioned history & backups',
            ],
            'price' => '$8',
            'period' => '/mo',
            'originalPrice' => '$12',
            'cta' => 'Start free trial',
            'href' => '#',
        ],
        [
            'name' => 'Enterprise',
            'accent' => 'secondary',
            'recommended' => false,
            'features' => [
                'SSO, SCIM & audit logs',
                'Dedicated support & SLA',
                'Self-hosted or private cloud',
            ],
            'price' => 'Custom',
            'period' => '',
            'originalPrice' => null,
            'cta' => 'Contact sales',
            'href' => '#',
        ],
    ];
@endphp

<x-ui.section space="xl" {{ $attributes }} data-slot="pricing-horizontal">
    <x-ui.container size="md" gutter="sm">
        <div class="mx-auto max-w-2xl text-center">
            <h2 class="text-balance text-3xl font-bold tracking-tight sm:text-4xl">{{ __($heading) }}</h2>
            <p class="mt-4 text-pretty text-xl text-muted-foreground">{{ __($subheading) }}</p>
        </div>

        <div class="mx-auto mt-12 flex flex-col gap-6">
            @foreach ($plans as $plan)
                @php
                    $accentKey = $plan['accent'] ?? $defaultAccent;
                    $gradient = $accents[$accentKey] ?? $accents[$defaultAccent];
                    $iconPath = $icons[$accentKey] ?? $icons[$defaultAccent];
                    $recommended = $plan['recommended'] ?? false;
                @endphp

                <x-ui.card @class([
                    'flex flex-col overflow-hidden p-0 sm:flex-row',
                    'ring-2 ring-primary shadow-lg' => $recommended,
                ])>
                    {{-- LEFT: accent gradient blob with decorative icon --}}
                    <div @class([
                        'flex w-full shrink-0 items-center justify-center bg-gradient-to-br p-8 text-primary-foreground sm:w-40 sm:self-stretch',
                        $gradient,
                    ])>
                        <svg class="size-12 sm:size-14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
                            <path d="{{ $iconPath }}" />
                        </svg>
                    </div>

                    {{-- RIGHT: name + badge, features, pricing, CTA --}}
                    <div class="flex flex-1 flex-col gap-6 p-6 sm:flex-row sm:items-center sm:justify-between sm:gap-8">
                        <div class="flex flex-1 flex-col gap-4">
                            <div class="flex flex-wrap items-center gap-2">
                                <h3 class="text-xl font-semibold tracking-tight">{{ __($plan['name']) }}</h3>
                                @if ($recommended)
                                    <x-ui.badge>{{ __('Recommended') }}</x-ui.badge>
                                @endif
                            </div>

                            @if (! empty($plan['features']))
                                <x-ui.check-list size="sm" class="text-muted-foreground">
                                    @foreach ($plan['features'] as $feature)
                                        <x-ui.check-list.item>{{ __($feature) }}</x-ui.check-list.item>
                                    @endforeach
                                </x-ui.check-list>
                            @endif
                        </div>

                        <div class="flex shrink-0 flex-col items-start gap-4 sm:items-end">
                            <div class="flex items-baseline gap-2">
                                @if (! empty($plan['originalPrice']))
                                    <del class="text-sm text-muted-foreground">{{ $plan['originalPrice'] }}</del>
                                @endif
                                <span class="text-3xl font-bold tracking-tight">{{ $plan['price'] }}</span>
                                @if (! empty($plan['period']))
                                    <span class="text-sm text-muted-foreground">{{ __($plan['period']) }}</span>
                                @endif
                            </div>

                            <x-ui.button
                                :href="$plan['href'] ?? '#'"
                                :variant="$recommended ? 'default' : 'outline'"
                                class="w-full sm:w-auto"
                            >
                                {{ __($plan['cta']) }}
                            </x-ui.button>
                        </div>
                    </div>
                </x-ui.card>
            @endforeach
        </div>
    </x-ui.container>
</x-ui.section>

Installation

terminal
php artisan ui:add blocks/pricing-horizontal

Installs these dependencies automatically:

Registry contract

Install confidence

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

Registry dependencies

badge button card check-list container 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.

pricing-horizontal.md
# Brok UI block: Pricing Horizontal (`pricing-horizontal`)

A horizontal list-style pricing layout where each plan pairs a gradient accent panel with a feature list, strikethrough original price, an optional Recommended badge, and a CTA.

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/pricing-horizontal
```

## Render it

```blade
<x-blocks.pricing-horizontal />
```

## Props

- `heading` (string, default `Organize without limits`) — Section headline.
- `subheading` (string, default `Local or cloud — your choice.`) — Supporting copy under the heading.
- `plans` (mixed|null, default `null`) — Array of horizontal plan rows ({name, accent, recommended, features, price, period, ...}); null falls back to sample plans.

## Use when

- Presenting plans as a horizontal list where each row pairs a gradient accent panel with its feature list.
- Showing a strikethrough original price beside a discounted price, with an optional Recommended badge.

## Avoid when

- Wanting a grid-of-cards layout instead of stacked horizontal rows; use pricing-cards or pricing-gradient.

## Rules

- Render the installed block with `<x-blocks.pricing-horizontal />` 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/pricing-horizontal
- Registry JSON (files, props, contract): https://brokui.dev/r/open/blocks/pricing-horizontal.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 plans as a horizontal list where each row pairs a gradient accent panel with its feature list.
  • Showing a strikethrough original price beside a discounted price, with an optional Recommended badge.

Avoid when

  • Wanting a grid-of-cards layout instead of stacked horizontal rows; use pricing-cards or pricing-gradient.

Anti-patterns

  • Do not replace semantic props with conflicting utility classes.
  • Do not remove labels, focus styles, or state attributes.
Anatomy
section heading horizontal plan rows gradient accent panel feature list strikethrough price recommended badge cta

Usage

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

resources/views/welcome.blade.php Blade
<x-blocks.pricing-horizontal />

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/pricing-horizontal.blade.php Blade
@props([
    'heading' => 'Organize without limits',
    'subheading' => 'Local or cloud — your choice.',
    'plans' => null,
])

@php
    // Fixed token-gradient map — whole class strings picked by key. Never splice a
    // variable into an arbitrary class (JIT can't see it); never raw colour.
    $accents = [
        'primary' => 'from-primary to-accent',
        'secondary' => 'from-secondary to-primary',
        'muted' => 'from-muted to-accent',
    ];
    $defaultAccent = 'primary';

    // Fixed icon map keyed by accent — decorative, currentColor, token-coloured text.
    $icons = [
        'primary' => 'M3.75 3.75h16.5v16.5H3.75zM8.25 8.25h7.5v7.5h-7.5z',
        'secondary' => 'M12 2.25 2.25 7.5 12 12.75 21.75 7.5 12 2.25zM2.25 12 12 17.25 21.75 12M2.25 16.5 12 21.75 21.75 16.5',
        'muted' => 'M12 21.75a9.75 9.75 0 1 0 0-19.5 9.75 9.75 0 0 0 0 19.5zM12 6v6l4.5 2.25',
    ];

    $plans ??= [
        [
            'name' => 'Local',
            'accent' => 'muted',
            'recommended' => false,
            'features' => [
                'Unlimited boards on your machine',
                'Offline-first, zero latency',
                'Export anytime, you own the data',
            ],
            'price' => '$0',
            'period' => '/forever',
            'originalPrice' => null,
            'cta' => 'Download free',
            'href' => '#',
        ],
        [
            'name' => 'Cloud',
            'accent' => 'primary',
            'recommended' => true,
            'features' => [
                'Real-time sync across devices',
                'Team workspaces & sharing',
                'Versioned history & backups',
            ],
            'price' => '$8',
            'period' => '/mo',
            'originalPrice' => '$12',
            'cta' => 'Start free trial',
            'href' => '#',
        ],
        [
            'name' => 'Enterprise',
            'accent' => 'secondary',
            'recommended' => false,
            'features' => [
                'SSO, SCIM & audit logs',
                'Dedicated support & SLA',
                'Self-hosted or private cloud',
            ],
            'price' => 'Custom',
            'period' => '',
            'originalPrice' => null,
            'cta' => 'Contact sales',
            'href' => '#',
        ],
    ];
@endphp

<x-ui.section space="xl" {{ $attributes }} data-slot="pricing-horizontal">
    <x-ui.container size="md" gutter="sm">
        <div class="mx-auto max-w-2xl text-center">
            <h2 class="text-balance text-3xl font-bold tracking-tight sm:text-4xl">{{ __($heading) }}</h2>
            <p class="mt-4 text-pretty text-xl text-muted-foreground">{{ __($subheading) }}</p>
        </div>

        <div class="mx-auto mt-12 flex flex-col gap-6">
            @foreach ($plans as $plan)
                @php
                    $accentKey = $plan['accent'] ?? $defaultAccent;
                    $gradient = $accents[$accentKey] ?? $accents[$defaultAccent];
                    $iconPath = $icons[$accentKey] ?? $icons[$defaultAccent];
                    $recommended = $plan['recommended'] ?? false;
                @endphp

                <x-ui.card @class([
                    'flex flex-col overflow-hidden p-0 sm:flex-row',
                    'ring-2 ring-primary shadow-lg' => $recommended,
                ])>
                    {{-- LEFT: accent gradient blob with decorative icon --}}
                    <div @class([
                        'flex w-full shrink-0 items-center justify-center bg-gradient-to-br p-8 text-primary-foreground sm:w-40 sm:self-stretch',
                        $gradient,
                    ])>
                        <svg class="size-12 sm:size-14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
                            <path d="{{ $iconPath }}" />
                        </svg>
                    </div>

                    {{-- RIGHT: name + badge, features, pricing, CTA --}}
                    <div class="flex flex-1 flex-col gap-6 p-6 sm:flex-row sm:items-center sm:justify-between sm:gap-8">
                        <div class="flex flex-1 flex-col gap-4">
                            <div class="flex flex-wrap items-center gap-2">
                                <h3 class="text-xl font-semibold tracking-tight">{{ __($plan['name']) }}</h3>
                                @if ($recommended)
                                    <x-ui.badge>{{ __('Recommended') }}</x-ui.badge>
                                @endif
                            </div>

                            @if (! empty($plan['features']))
                                <x-ui.check-list size="sm" class="text-muted-foreground">
                                    @foreach ($plan['features'] as $feature)
                                        <x-ui.check-list.item>{{ __($feature) }}</x-ui.check-list.item>
                                    @endforeach
                                </x-ui.check-list>
                            @endif
                        </div>

                        <div class="flex shrink-0 flex-col items-start gap-4 sm:items-end">
                            <div class="flex items-baseline gap-2">
                                @if (! empty($plan['originalPrice']))
                                    <del class="text-sm text-muted-foreground">{{ $plan['originalPrice'] }}</del>
                                @endif
                                <span class="text-3xl font-bold tracking-tight">{{ $plan['price'] }}</span>
                                @if (! empty($plan['period']))
                                    <span class="text-sm text-muted-foreground">{{ __($plan['period']) }}</span>
                                @endif
                            </div>

                            <x-ui.button
                                :href="$plan['href'] ?? '#'"
                                :variant="$recommended ? 'default' : 'outline'"
                                class="w-full sm:w-auto"
                            >
                                {{ __($plan['cta']) }}
                            </x-ui.button>
                        </div>
                    </div>
                </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