Pricing
pricing-10
Two plan cards with icon, price and a two-column feature list, plus Monthly / Yearly tabs beside a left-aligned heading.
{{--
Every piece of content is a prop, so you can drive this section from a CMS.
Each plan carries a monthly price (price + period) and a yearly one
(yearlyPrice + yearlyPeriod); the Monthly / Yearly tabs swap between them.
Pass 'icon' => '<svg ...>' on a plan to replace the default logo tile.
<x-ui.blocks.pricing-10
tagline="Pricing"
heading="Simple plans for every team"
description="Start free, upgrade when you need more seats."
monthly-label="Monthly"
yearly-label="Yearly"
:plans="[
[
'name' => 'Starter',
'description' => 'For side projects',
'price' => '$9',
'period' => '/mo',
'yearlyPrice' => '$90',
'yearlyPeriod' => '/yr',
'features' => ['3 projects', 'Email support'],
'buttonLabel' => 'Start free',
'buttonHref' => '/register',
],
[
'name' => 'Team',
'description' => 'For growing teams',
'price' => '$29',
'period' => '/mo',
'yearlyPrice' => '$290',
'yearlyPeriod' => '/yr',
'features' => ['Unlimited projects', 'Priority support'],
'buttonLabel' => 'Choose Team',
'buttonHref' => '/register?plan=team',
],
]"
/>
--}}
@props([
'tagline' => 'Tagline',
'heading' => 'Pricing plan',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.',
'monthlyLabel' => 'Monthly',
'yearlyLabel' => 'Yearly',
'includesLabel' => 'Includes:',
'plans' => [
[
'name' => 'Basic plan',
'description' => 'Lorem ipsum dolor sit amet',
'price' => '$19',
'period' => '/mo',
'yearlyPrice' => '$199',
'yearlyPeriod' => '/yr',
'features' => array_fill(0, 6, 'Feature text goes here'),
'buttonLabel' => 'Get started',
'buttonHref' => null,
],
[
'name' => 'Business plan',
'description' => 'Lorem ipsum dolor sit amet',
'price' => '$29',
'period' => '/mo',
'yearlyPrice' => '$299',
'yearlyPeriod' => '/yr',
'features' => array_fill(0, 10, 'Feature text goes here'),
'buttonLabel' => 'Get started',
'buttonHref' => null,
],
],
])
<section {{ $attributes->merge(['class' => 'w-full bg-background px-[5%] py-16 text-foreground md:py-24 lg:py-28']) }}>
{{-- The tabs root is display:contents here, so its tab strip and panels
join this grid: the strip sits beside the heading on desktop and the
panels span the full row below. --}}
<div
class="mx-auto grid max-w-7xl grid-cols-1 gap-12 md:grid-cols-[1fr_auto] md:items-end md:gap-x-8 md:gap-y-20 [&>[data-ui-tabs]]:contents md:[&_[role=tabpanel]]:col-span-2">
<div class="flex max-w-3xl flex-col gap-3 md:gap-4">
@if ($tagline)
<p class="font-semibold">{{ $tagline }}</p>
@endif
<div class="flex flex-col gap-5 md:gap-6">
<h2 class="text-4xl font-bold leading-[1.2] md:text-5xl">{{ $heading }}</h2>
@if ($description)
<p class="text-muted-foreground md:text-lg">{{ $description }}</p>
@endif
</div>
</div>
<x-ui.tabs :tabs="['monthly' => $monthlyLabel, 'yearly' => $yearlyLabel]">
@foreach (['monthly', 'yearly'] as $billing)
<x-slot :name="'tab_' . $billing">
<div class="grid grid-cols-1 gap-8 md:grid-cols-2">
@foreach ($plans as $plan)
@php
$price = $billing === 'yearly' ? $plan['yearlyPrice'] ?? '' : $plan['price'] ?? '';
$period = $billing === 'yearly' ? $plan['yearlyPeriod'] ?? '' : $plan['period'] ?? '';
@endphp
<x-ui.card class="justify-between gap-8 rounded-lg py-8 shadow-none">
<div class="flex flex-col gap-8">
<div class="flex items-start justify-between gap-4">
<div class="flex flex-col gap-4">
@if (!empty($plan['icon']))
{!! $plan['icon'] !!}
@else
<span
class="flex size-12 items-center justify-center rounded-md bg-primary text-primary-foreground">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round" class="size-6"
aria-hidden="true">
<path d="M12 2 2 7l10 5 10-5-10-5Z" />
<path d="m2 17 10 5 10-5" />
<path d="m2 12 10 5 10-5" />
</svg>
</span>
@endif
<div class="flex flex-col gap-2">
<h3 class="text-xl font-bold leading-[1.4] md:text-2xl">
{{ $plan['name'] ?? '' }}</h3>
@if (!empty($plan['description']))
<p class="text-muted-foreground">{{ $plan['description'] }}</p>
@endif
</div>
</div>
<p class="shrink-0 whitespace-nowrap font-bold">
<span dir="ltr"><span class="text-[2.5rem] leading-[1.2] md:text-[3.5rem]">{{ $price }}</span><span
class="text-2xl leading-[1.4] md:text-[2rem] md:leading-[1.3]">{{ $period }}</span></span>
</p>
</div>
<x-ui.separator />
<div class="flex flex-col gap-4">
@if ($includesLabel)
<p>{{ $includesLabel }}</p>
@endif
<ul class="grid grid-cols-1 gap-4 py-2 lg:grid-cols-2 lg:gap-x-6">
@foreach ($plan['features'] ?? [] as $feature)
<li class="flex items-start gap-4">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round"
class="size-6 shrink-0" aria-hidden="true">
<path d="M20 6 9 17l-5-5" />
</svg>
<span>{{ $feature }}</span>
</li>
@endforeach
</ul>
</div>
</div>
<x-slot:footer>
<x-ui.button :href="$plan['buttonHref'] ?? null" size="lg" class="w-full">
{{ $plan['buttonLabel'] ?? 'Get started' }}</x-ui.button>
</x-slot:footer>
</x-ui.card>
@endforeach
</div>
</x-slot>
@endforeach
</x-ui.tabs>
</div>
</section>
Installation
php artisan ui:add-block pricing-10
A single command installs the block's Blade file and every component it depends on. Render it in your own layout as
<x-ui.blocks.pricing-10
/>.
1. Install component dependencies
php artisan ui:add button card separator tabs
2. External packages
- composer:
gehrisandro/tailwind-merge-laravel
3.
Copy the block source into
resources/views/components/ui/
resources/views/components/ui/blocks/pricing-10.blade.php
{{--
Every piece of content is a prop, so you can drive this section from a CMS.
Each plan carries a monthly price (price + period) and a yearly one
(yearlyPrice + yearlyPeriod); the Monthly / Yearly tabs swap between them.
Pass 'icon' => '<svg ...>' on a plan to replace the default logo tile.
<x-ui.blocks.pricing-10
tagline="Pricing"
heading="Simple plans for every team"
description="Start free, upgrade when you need more seats."
monthly-label="Monthly"
yearly-label="Yearly"
:plans="[
[
'name' => 'Starter',
'description' => 'For side projects',
'price' => '$9',
'period' => '/mo',
'yearlyPrice' => '$90',
'yearlyPeriod' => '/yr',
'features' => ['3 projects', 'Email support'],
'buttonLabel' => 'Start free',
'buttonHref' => '/register',
],
[
'name' => 'Team',
'description' => 'For growing teams',
'price' => '$29',
'period' => '/mo',
'yearlyPrice' => '$290',
'yearlyPeriod' => '/yr',
'features' => ['Unlimited projects', 'Priority support'],
'buttonLabel' => 'Choose Team',
'buttonHref' => '/register?plan=team',
],
]"
/>
--}}
@props([
'tagline' => 'Tagline',
'heading' => 'Pricing plan',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.',
'monthlyLabel' => 'Monthly',
'yearlyLabel' => 'Yearly',
'includesLabel' => 'Includes:',
'plans' => [
[
'name' => 'Basic plan',
'description' => 'Lorem ipsum dolor sit amet',
'price' => '$19',
'period' => '/mo',
'yearlyPrice' => '$199',
'yearlyPeriod' => '/yr',
'features' => array_fill(0, 6, 'Feature text goes here'),
'buttonLabel' => 'Get started',
'buttonHref' => null,
],
[
'name' => 'Business plan',
'description' => 'Lorem ipsum dolor sit amet',
'price' => '$29',
'period' => '/mo',
'yearlyPrice' => '$299',
'yearlyPeriod' => '/yr',
'features' => array_fill(0, 10, 'Feature text goes here'),
'buttonLabel' => 'Get started',
'buttonHref' => null,
],
],
])
<section {{ $attributes->merge(['class' => 'w-full bg-background px-[5%] py-16 text-foreground md:py-24 lg:py-28']) }}>
{{-- The tabs root is display:contents here, so its tab strip and panels
join this grid: the strip sits beside the heading on desktop and the
panels span the full row below. --}}
<div
class="mx-auto grid max-w-7xl grid-cols-1 gap-12 md:grid-cols-[1fr_auto] md:items-end md:gap-x-8 md:gap-y-20 [&>[data-ui-tabs]]:contents md:[&_[role=tabpanel]]:col-span-2">
<div class="flex max-w-3xl flex-col gap-3 md:gap-4">
@if ($tagline)
<p class="font-semibold">{{ $tagline }}</p>
@endif
<div class="flex flex-col gap-5 md:gap-6">
<h2 class="text-4xl font-bold leading-[1.2] md:text-5xl">{{ $heading }}</h2>
@if ($description)
<p class="text-muted-foreground md:text-lg">{{ $description }}</p>
@endif
</div>
</div>
<x-ui.tabs :tabs="['monthly' => $monthlyLabel, 'yearly' => $yearlyLabel]">
@foreach (['monthly', 'yearly'] as $billing)
<x-slot :name="'tab_' . $billing">
<div class="grid grid-cols-1 gap-8 md:grid-cols-2">
@foreach ($plans as $plan)
@php
$price = $billing === 'yearly' ? $plan['yearlyPrice'] ?? '' : $plan['price'] ?? '';
$period = $billing === 'yearly' ? $plan['yearlyPeriod'] ?? '' : $plan['period'] ?? '';
@endphp
<x-ui.card class="justify-between gap-8 rounded-lg py-8 shadow-none">
<div class="flex flex-col gap-8">
<div class="flex items-start justify-between gap-4">
<div class="flex flex-col gap-4">
@if (!empty($plan['icon']))
{!! $plan['icon'] !!}
@else
<span
class="flex size-12 items-center justify-center rounded-md bg-primary text-primary-foreground">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round" class="size-6"
aria-hidden="true">
<path d="M12 2 2 7l10 5 10-5-10-5Z" />
<path d="m2 17 10 5 10-5" />
<path d="m2 12 10 5 10-5" />
</svg>
</span>
@endif
<div class="flex flex-col gap-2">
<h3 class="text-xl font-bold leading-[1.4] md:text-2xl">
{{ $plan['name'] ?? '' }}</h3>
@if (!empty($plan['description']))
<p class="text-muted-foreground">{{ $plan['description'] }}</p>
@endif
</div>
</div>
<p class="shrink-0 whitespace-nowrap font-bold">
<span dir="ltr"><span class="text-[2.5rem] leading-[1.2] md:text-[3.5rem]">{{ $price }}</span><span
class="text-2xl leading-[1.4] md:text-[2rem] md:leading-[1.3]">{{ $period }}</span></span>
</p>
</div>
<x-ui.separator />
<div class="flex flex-col gap-4">
@if ($includesLabel)
<p>{{ $includesLabel }}</p>
@endif
<ul class="grid grid-cols-1 gap-4 py-2 lg:grid-cols-2 lg:gap-x-6">
@foreach ($plan['features'] ?? [] as $feature)
<li class="flex items-start gap-4">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round"
class="size-6 shrink-0" aria-hidden="true">
<path d="M20 6 9 17l-5-5" />
</svg>
<span>{{ $feature }}</span>
</li>
@endforeach
</ul>
</div>
</div>
<x-slot:footer>
<x-ui.button :href="$plan['buttonHref'] ?? null" size="lg" class="w-full">
{{ $plan['buttonLabel'] ?? 'Get started' }}</x-ui.button>
</x-slot:footer>
</x-ui.card>
@endforeach
</div>
</x-slot>
@endforeach
</x-ui.tabs>
</div>
</section>
Usage
Every piece of content is a prop, so you can drive this section from a CMS. Each plan carries a monthly price (price + period) and a yearly one (yearlyPrice + yearlyPeriod); the Monthly / Yearly tabs swap between them. Pass 'icon' => '<svg ...>' on a plan to replace the default logo tile.
<x-ui.blocks.pricing-10
tagline="Pricing"
heading="Simple plans for every team"
description="Start free, upgrade when you need more seats."
monthly-label="Monthly"
yearly-label="Yearly"
:plans="[
[
'name' => 'Starter',
'description' => 'For side projects',
'price' => '$9',
'period' => '/mo',
'yearlyPrice' => '$90',
'yearlyPeriod' => '/yr',
'features' => ['3 projects', 'Email support'],
'buttonLabel' => 'Start free',
'buttonHref' => '/register',
],
[
'name' => 'Team',
'description' => 'For growing teams',
'price' => '$29',
'period' => '/mo',
'yearlyPrice' => '$290',
'yearlyPeriod' => '/yr',
'features' => ['Unlimited projects', 'Priority support'],
'buttonLabel' => 'Choose Team',
'buttonHref' => '/register?plan=team',
],
]"
/>
Props
Every prop with its default. Pass any of them as attributes, using : to bind a PHP value.
@props([
'tagline' => 'Tagline',
'heading' => 'Pricing plan',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.',
'monthlyLabel' => 'Monthly',
'yearlyLabel' => 'Yearly',
'includesLabel' => 'Includes:',
'plans' => [
[
'name' => 'Basic plan',
'description' => 'Lorem ipsum dolor sit amet',
'price' => '$19',
'period' => '/mo',
'yearlyPrice' => '$199',
'yearlyPeriod' => '/yr',
'features' => array_fill(0, 6, 'Feature text goes here'),
'buttonLabel' => 'Get started',
'buttonHref' => null,
],
[
'name' => 'Business plan',
'description' => 'Lorem ipsum dolor sit amet',
'price' => '$29',
'period' => '/mo',
'yearlyPrice' => '$299',
'yearlyPeriod' => '/yr',
'features' => array_fill(0, 10, 'Feature text goes here'),
'buttonLabel' => 'Get started',
'buttonHref' => null,
],
],
])