Skip to content
Brok UI

Loading…

No results

Paywall

Open source

Conversion paywalls — inline plan upgrade, gated article content and a focused subscription card with billing toggle.

Preview

resources/views/blocks/paywall-pricing.blade.php Blade
@props([
    'planName'       => 'Pro',
    'heading'        => 'Unlock everything',
    'monthlyPrice'   => 12,
    'features'       => [
        'Unlimited projects & collaborators',
        'Advanced analytics dashboard',
        'Priority email & chat support',
        'Custom domain & branding',
        'Team roles & permissions',
    ],
])

<x-ui.section
    space="xl" {{ $attributes }}
    x-data="{
        yearly: false,
        monthly: {{ (int) $monthlyPrice }},
        get yearlyTotal() { return Math.round(this.monthly * 10); },
        get monthlyEquiv() { return Math.round(this.monthly * 10 / 12); },
        init() {},
        destroy() {}
    }"
>
    <div class="mx-auto max-w-md px-4">
        <x-ui.card class="shadow-lg ring-1 ring-border">

            <x-ui.card.header class="pb-2 text-center">

                {{-- Plan name --}}
                <p class="mb-2 text-sm font-medium uppercase tracking-widest text-muted-foreground">
                    {{ __($planName) }}
                </p>

                <x-ui.card.title class="text-2xl font-bold tracking-tight">
                    {{ __($heading) }}
                </x-ui.card.title>

                {{-- Billing toggle --}}
                <div class="mt-6 flex items-center justify-center gap-4">
                    <span
                        class="text-sm transition-colors"
                        :class="yearly ? 'text-muted-foreground' : 'font-medium text-foreground'"
                    >
                        {{ __('Monthly') }}
                    </span>

                    <x-ui.switch
                        x-model="yearly"
                        aria-label="{{ __('Toggle yearly billing') }}"
                    />

                    <span
                        class="flex items-center gap-2 text-sm transition-colors"
                        :class="yearly ? 'font-medium text-foreground' : 'text-muted-foreground'"
                    >
                        {{ __('Yearly') }}
                        <x-ui.badge variant="success" class="text-sm">
                            {{ __('2 months free') }}
                        </x-ui.badge>
                    </span>
                </div>

            </x-ui.card.header>

            <x-ui.card.content class="pt-4">

                {{-- Price display --}}
                <div class="mb-2 text-center">
                    <span class="text-5xl font-bold tracking-tight text-foreground">
                        $<span x-text="yearly ? yearlyTotal : monthly"></span>
                    </span>
                    <span class="text-sm text-muted-foreground" x-text="yearly ? '/yr' : '/mo'"></span>
                </div>

                {{-- Monthly equivalent caption (visible when yearly) --}}
                <p
                    class="mb-6 min-h-[1.25rem] text-center text-sm text-muted-foreground transition-opacity"
                    :class="yearly ? 'opacity-100' : 'opacity-0'"
                    aria-live="polite"
                >
                    {{ __('≈ $') }}<span x-text="monthlyEquiv"></span>{{ __('/mo') }}
                </p>

                {{-- Feature checklist --}}
                <x-ui.check-list aria-label="{{ __('Included features') }}">
                    @foreach ($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 class="flex flex-col gap-4 pb-8">

                <x-ui.button class="w-full" size="lg">
                    {{ __('Continue') }}
                </x-ui.button>

                {{-- Trust row --}}
                <p class="flex items-center justify-center gap-2 text-sm text-muted-foreground">
                    <svg class="size-4 shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
                        <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>
                    </svg>
                    {{ __('Cancel anytime, Secure checkout') }}
                </p>

            </x-ui.card.footer>

        </x-ui.card>
    </div>
</x-ui.section>

Installation

terminal
php artisan ui:add blocks/paywall-pricing

Installs these dependencies automatically:

Registry contract

Install confidence

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

Registry dependencies

badge button card check-list section switch

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.

paywall-pricing.md
# Brok UI block: Paywall Pricing (`paywall-pricing`)

Focused subscription card with Alpine-driven monthly/yearly toggle, live price display, feature checklist, and trust footer.

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

## Render it

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

## Props

- `plan-name` (string, default `Pro`) — Plan name shown above the heading.
- `heading` (string, default `Unlock everything`) — Card headline.
- `monthly-price` (int, default `12`) — Monthly price in whole currency units; drives the yearly total and monthly-equivalent calculations.
- `features` (array, default `[…]`) — Array of feature strings rendered in the checklist.

## Use when

- Showing a single-plan subscription card with an Alpine-driven monthly/yearly switch that updates the live price.
- Highlighting an annual-billing discount with a monthly-equivalent caption and a feature checklist.

## Avoid when

- Gating existing content inline (paywall-content) or showing a generic upgrade CTA without a billing toggle (paywall-upgrade).

## Rules

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

  • Showing a single-plan subscription card with an Alpine-driven monthly/yearly switch that updates the live price.
  • Highlighting an annual-billing discount with a monthly-equivalent caption and a feature checklist.

Avoid when

  • Gating existing content inline (paywall-content) or showing a generic upgrade CTA without a billing toggle (paywall-upgrade).

Anti-patterns

  • Do not replace semantic props with conflicting utility classes.
  • Do not remove labels, focus styles, or state attributes.
Anatomy
section with billing toggle plan name heading monthly/yearly switch live price display monthly-equivalent caption feature checklist continue cta trust row

Usage

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

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

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/paywall-pricing.blade.php Blade
@props([
    'planName'       => 'Pro',
    'heading'        => 'Unlock everything',
    'monthlyPrice'   => 12,
    'features'       => [
        'Unlimited projects & collaborators',
        'Advanced analytics dashboard',
        'Priority email & chat support',
        'Custom domain & branding',
        'Team roles & permissions',
    ],
])

<x-ui.section
    space="xl" {{ $attributes }}
    x-data="{
        yearly: false,
        monthly: {{ (int) $monthlyPrice }},
        get yearlyTotal() { return Math.round(this.monthly * 10); },
        get monthlyEquiv() { return Math.round(this.monthly * 10 / 12); },
        init() {},
        destroy() {}
    }"
>
    <div class="mx-auto max-w-md px-4">
        <x-ui.card class="shadow-lg ring-1 ring-border">

            <x-ui.card.header class="pb-2 text-center">

                {{-- Plan name --}}
                <p class="mb-2 text-sm font-medium uppercase tracking-widest text-muted-foreground">
                    {{ __($planName) }}
                </p>

                <x-ui.card.title class="text-2xl font-bold tracking-tight">
                    {{ __($heading) }}
                </x-ui.card.title>

                {{-- Billing toggle --}}
                <div class="mt-6 flex items-center justify-center gap-4">
                    <span
                        class="text-sm transition-colors"
                        :class="yearly ? 'text-muted-foreground' : 'font-medium text-foreground'"
                    >
                        {{ __('Monthly') }}
                    </span>

                    <x-ui.switch
                        x-model="yearly"
                        aria-label="{{ __('Toggle yearly billing') }}"
                    />

                    <span
                        class="flex items-center gap-2 text-sm transition-colors"
                        :class="yearly ? 'font-medium text-foreground' : 'text-muted-foreground'"
                    >
                        {{ __('Yearly') }}
                        <x-ui.badge variant="success" class="text-sm">
                            {{ __('2 months free') }}
                        </x-ui.badge>
                    </span>
                </div>

            </x-ui.card.header>

            <x-ui.card.content class="pt-4">

                {{-- Price display --}}
                <div class="mb-2 text-center">
                    <span class="text-5xl font-bold tracking-tight text-foreground">
                        $<span x-text="yearly ? yearlyTotal : monthly"></span>
                    </span>
                    <span class="text-sm text-muted-foreground" x-text="yearly ? '/yr' : '/mo'"></span>
                </div>

                {{-- Monthly equivalent caption (visible when yearly) --}}
                <p
                    class="mb-6 min-h-[1.25rem] text-center text-sm text-muted-foreground transition-opacity"
                    :class="yearly ? 'opacity-100' : 'opacity-0'"
                    aria-live="polite"
                >
                    {{ __('≈ $') }}<span x-text="monthlyEquiv"></span>{{ __('/mo') }}
                </p>

                {{-- Feature checklist --}}
                <x-ui.check-list aria-label="{{ __('Included features') }}">
                    @foreach ($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 class="flex flex-col gap-4 pb-8">

                <x-ui.button class="w-full" size="lg">
                    {{ __('Continue') }}
                </x-ui.button>

                {{-- Trust row --}}
                <p class="flex items-center justify-center gap-2 text-sm text-muted-foreground">
                    <svg class="size-4 shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
                        <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>
                    </svg>
                    {{ __('Cancel anytime, Secure checkout') }}
                </p>

            </x-ui.card.footer>

        </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