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

1 of 10

resources/views/blocks/pricing-simple.blade.php Blade
@props([
    'heading' => 'Pricing',
    'subheading' => 'Simple, transparent pricing that grows with you.',
    'plans' => null,
    'billingToggle' => false,
])

@php
    $plans ??= $billingToggle
        ? [
            ['name' => 'Starter', 'monthlyPrice' => 0, 'annualPrice' => 0, 'featured' => false, 'cta' => 'Get started', 'features' => ['1 project', 'Community support', 'Basic analytics']],
            ['name' => 'Pro', 'monthlyPrice' => 29, 'annualPrice' => 24, 'featured' => true, 'cta' => 'Start free trial', 'features' => ['Unlimited projects', 'Priority support', 'Advanced analytics', 'Pro blocks']],
            ['name' => 'Team', 'monthlyPrice' => 99, 'annualPrice' => 82, 'featured' => false, 'cta' => 'Contact sales', 'features' => ['Everything in Pro', 'SSO & roles', 'Audit logs', 'Dedicated support']],
        ]
        : [
            ['name' => 'Starter', 'price' => '$0', 'period' => '/mo', 'featured' => false, 'cta' => 'Get started', 'features' => ['1 project', 'Community support', 'Basic components']],
            ['name' => 'Pro', 'price' => '$29', 'period' => '/mo', 'featured' => true, 'cta' => 'Start free trial', 'features' => ['Unlimited projects', 'Priority support', 'All components', 'Pro blocks']],
            ['name' => 'Team', 'price' => '$99', 'period' => '/mo', 'featured' => false, 'cta' => 'Contact sales', 'features' => ['Everything in Pro', 'SSO & roles', 'Audit logs', 'Dedicated support']],
        ];
@endphp

<section
    data-slot="pricing-02"
    @if ($billingToggle) x-data="{ annual: false }" @endif
    {{ $attributes->merge(['class' => 'bg-background py-16 text-foreground sm:py-24']) }}
>
    <div class="mx-auto max-w-6xl px-4">
        <div class="mx-auto max-w-2xl text-center">
            <h2 class="text-3xl font-bold tracking-tight sm:text-4xl">{{ __($heading) }}</h2>
            <p class="mt-4 text-lg text-muted-foreground">{{ __($subheading) }}</p>

            @if ($billingToggle)
                <div class="mt-8 inline-flex items-center gap-4">
                    <span class="text-sm font-medium" :class="! annual && 'text-foreground' || 'text-muted-foreground'">{{ __('Monthly') }}</span>
                    <x-ui.switch x-model="annual" aria-label="{{ __('Toggle annual billing') }}" />
                    <span class="text-sm font-medium" :class="annual && 'text-foreground' || 'text-muted-foreground'">{{ __('Annual') }}</span>
                    <x-ui.badge variant="success">{{ __('Save 17%') }}</x-ui.badge>
                </div>
            @endif
        </div>

        <div class="mt-12 grid gap-6 lg:grid-cols-3">
            @foreach ($plans as $plan)
                <x-ui.card @class([
                    'flex flex-col',
                    'border-primary ring-1 ring-primary' => $plan['featured'] ?? false,
                ])>
                    <x-ui.card.header>
                        @if ($plan['featured'] ?? false)
                            <x-ui.badge class="mb-2 w-fit">{{ __('Most popular') }}</x-ui.badge>
                        @endif

                        <x-ui.card.title class="text-lg">{{ __($plan['name']) }}</x-ui.card.title>

                        @if (! empty($plan['description']))
                            <x-ui.card.description>{{ __($plan['description']) }}</x-ui.card.description>
                        @endif

                        @if ($billingToggle)
                            <div class="mt-4 flex items-baseline gap-2">
                                <span class="text-3xl font-bold tracking-tight" x-text="'$' + ({{ Js::from($plan['monthlyPrice']) }} === 0 ? 0 : (annual ? {{ Js::from($plan['annualPrice']) }} : {{ Js::from($plan['monthlyPrice']) }}))">${{ $plan['monthlyPrice'] }}</span>
                                <span class="text-sm text-muted-foreground">{{ __('/mo') }}</span>
                            </div>
                            <p class="mt-2 text-sm text-muted-foreground" x-show="annual && {{ Js::from($plan['monthlyPrice']) }} > 0" x-cloak>{{ __('billed annually') }}</p>
                        @else
                            <div class="mt-2 flex items-baseline gap-2">
                                <span class="text-3xl font-bold tracking-tight">{{ $plan['price'] }}</span>
                                <span class="text-sm text-muted-foreground">{{ $plan['period'] ?? '' }}</span>
                            </div>
                        @endif
                    </x-ui.card.header>

                    <x-ui.card.content class="flex flex-1 flex-col gap-6">
                        <x-ui.separator />

                        <x-ui.check-list class="flex-1">
                            @foreach ($plan['features'] as $feature)
                                <x-ui.check-list.item>{{ __($feature) }}</x-ui.check-list.item>
                            @endforeach
                        </x-ui.check-list>
                    </x-ui.card.content>

                    <x-ui.card.footer>
                        <x-ui.button :variant="($plan['featured'] ?? false) ? 'default' : 'outline'" class="w-full">
                            {{ __($plan['cta']) }}
                        </x-ui.button>
                    </x-ui.card.footer>
                </x-ui.card>
            @endforeach
        </div>
    </div>
</section>

Installation

terminal
php artisan ui:add blocks/pricing-simple

Installs these dependencies automatically:

Registry contract

Install confidence

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

Registry dependencies

badge button card check-list separator switch

Package dependencies

composer: jml/brok:^0.2

npm: alpinejs

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-simple.md
# Brok UI block: Pricing (`pricing-simple`)

A responsive three-tier pricing section built from card, badge, separator, and button primitives, with an optional Alpine monthly/annual billing toggle.

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

## Render it

```blade
<x-blocks.pricing-simple billing-toggle="false" />
```

## Props

- `billing-toggle` (boolean, default `false`) (variant) — Shows an Alpine monthly/annual switch and reads each plan's monthlyPrice/annualPrice instead of a static price/period pair.

## Use when

- Presenting three pricing tiers as cards with a features checklist, a Most popular badge and a CTA per plan.
- Needing an optional Alpine monthly/annual billing toggle that swaps each plan's displayed price live.

## Avoid when

- Comparing plans feature-by-feature in a table; use comparison-plans-table instead.

## Rules

- Render the installed block with `<x-blocks.pricing-simple />` 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-simple
- Registry JSON (files, props, contract): https://brokui.dev/r/open/blocks/pricing-simple.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 three pricing tiers as cards with a features checklist, a Most popular badge and a CTA per plan.
  • Needing an optional Alpine monthly/annual billing toggle that swaps each plan's displayed price live.

Avoid when

  • Comparing plans feature-by-feature in a table; use comparison-plans-table instead.

Anti-patterns

  • Do not replace semantic props with conflicting utility classes.
  • Do not remove labels, focus styles, or state attributes.
Anatomy
section heading/subheading billing toggle (optional) plan cards most-popular badge price display feature checklist cta button

Usage

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

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

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-simple.blade.php Blade
@props([
    'heading' => 'Pricing',
    'subheading' => 'Simple, transparent pricing that grows with you.',
    'plans' => null,
    'billingToggle' => false,
])

@php
    $plans ??= $billingToggle
        ? [
            ['name' => 'Starter', 'monthlyPrice' => 0, 'annualPrice' => 0, 'featured' => false, 'cta' => 'Get started', 'features' => ['1 project', 'Community support', 'Basic analytics']],
            ['name' => 'Pro', 'monthlyPrice' => 29, 'annualPrice' => 24, 'featured' => true, 'cta' => 'Start free trial', 'features' => ['Unlimited projects', 'Priority support', 'Advanced analytics', 'Pro blocks']],
            ['name' => 'Team', 'monthlyPrice' => 99, 'annualPrice' => 82, 'featured' => false, 'cta' => 'Contact sales', 'features' => ['Everything in Pro', 'SSO & roles', 'Audit logs', 'Dedicated support']],
        ]
        : [
            ['name' => 'Starter', 'price' => '$0', 'period' => '/mo', 'featured' => false, 'cta' => 'Get started', 'features' => ['1 project', 'Community support', 'Basic components']],
            ['name' => 'Pro', 'price' => '$29', 'period' => '/mo', 'featured' => true, 'cta' => 'Start free trial', 'features' => ['Unlimited projects', 'Priority support', 'All components', 'Pro blocks']],
            ['name' => 'Team', 'price' => '$99', 'period' => '/mo', 'featured' => false, 'cta' => 'Contact sales', 'features' => ['Everything in Pro', 'SSO & roles', 'Audit logs', 'Dedicated support']],
        ];
@endphp

<section
    data-slot="pricing-02"
    @if ($billingToggle) x-data="{ annual: false }" @endif
    {{ $attributes->merge(['class' => 'bg-background py-16 text-foreground sm:py-24']) }}
>
    <div class="mx-auto max-w-6xl px-4">
        <div class="mx-auto max-w-2xl text-center">
            <h2 class="text-3xl font-bold tracking-tight sm:text-4xl">{{ __($heading) }}</h2>
            <p class="mt-4 text-lg text-muted-foreground">{{ __($subheading) }}</p>

            @if ($billingToggle)
                <div class="mt-8 inline-flex items-center gap-4">
                    <span class="text-sm font-medium" :class="! annual && 'text-foreground' || 'text-muted-foreground'">{{ __('Monthly') }}</span>
                    <x-ui.switch x-model="annual" aria-label="{{ __('Toggle annual billing') }}" />
                    <span class="text-sm font-medium" :class="annual && 'text-foreground' || 'text-muted-foreground'">{{ __('Annual') }}</span>
                    <x-ui.badge variant="success">{{ __('Save 17%') }}</x-ui.badge>
                </div>
            @endif
        </div>

        <div class="mt-12 grid gap-6 lg:grid-cols-3">
            @foreach ($plans as $plan)
                <x-ui.card @class([
                    'flex flex-col',
                    'border-primary ring-1 ring-primary' => $plan['featured'] ?? false,
                ])>
                    <x-ui.card.header>
                        @if ($plan['featured'] ?? false)
                            <x-ui.badge class="mb-2 w-fit">{{ __('Most popular') }}</x-ui.badge>
                        @endif

                        <x-ui.card.title class="text-lg">{{ __($plan['name']) }}</x-ui.card.title>

                        @if (! empty($plan['description']))
                            <x-ui.card.description>{{ __($plan['description']) }}</x-ui.card.description>
                        @endif

                        @if ($billingToggle)
                            <div class="mt-4 flex items-baseline gap-2">
                                <span class="text-3xl font-bold tracking-tight" x-text="'$' + ({{ Js::from($plan['monthlyPrice']) }} === 0 ? 0 : (annual ? {{ Js::from($plan['annualPrice']) }} : {{ Js::from($plan['monthlyPrice']) }}))">${{ $plan['monthlyPrice'] }}</span>
                                <span class="text-sm text-muted-foreground">{{ __('/mo') }}</span>
                            </div>
                            <p class="mt-2 text-sm text-muted-foreground" x-show="annual && {{ Js::from($plan['monthlyPrice']) }} > 0" x-cloak>{{ __('billed annually') }}</p>
                        @else
                            <div class="mt-2 flex items-baseline gap-2">
                                <span class="text-3xl font-bold tracking-tight">{{ $plan['price'] }}</span>
                                <span class="text-sm text-muted-foreground">{{ $plan['period'] ?? '' }}</span>
                            </div>
                        @endif
                    </x-ui.card.header>

                    <x-ui.card.content class="flex flex-1 flex-col gap-6">
                        <x-ui.separator />

                        <x-ui.check-list class="flex-1">
                            @foreach ($plan['features'] as $feature)
                                <x-ui.check-list.item>{{ __($feature) }}</x-ui.check-list.item>
                            @endforeach
                        </x-ui.check-list>
                    </x-ui.card.content>

                    <x-ui.card.footer>
                        <x-ui.button :variant="($plan['featured'] ?? false) ? 'default' : 'outline'" class="w-full">
                            {{ __($plan['cta']) }}
                        </x-ui.button>
                    </x-ui.card.footer>
                </x-ui.card>
            @endforeach
        </div>
    </div>
</section>

Ownership & lifecycle

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