Pricing
pricing-05
Split layout: key features with icons on one side, a single plan card with price, a two-column feature list and a button on the other.
{{--
Every piece of content is a prop, so you can drive this section from a CMS.
highlights is a list of ['title', 'description', 'icon'], where icon is an
optional '<svg ...>' string (the library mark when left out). plan is a
single ['name', 'price', 'period', 'description', 'features',
'buttonLabel', 'buttonHref'].
<x-ui.blocks.pricing-05
heading="One plan, everything in it"
:highlights="[
['title' => 'No seat limits', 'description' => 'Invite the whole team.'],
['title' => 'Cancel any time', 'description' => 'Monthly billing, no contract.'],
]"
:plan="[
'name' => 'Pro',
'price' => '$19',
'period' => '/mo',
'description' => 'Billed monthly',
'features' => ['Unlimited projects', 'Priority support', 'SSO'],
'buttonLabel' => 'Start trial',
'buttonHref' => '/register',
]"
/>
--}}
@props([
'tagline' => 'Tagline',
'heading' => 'Pricing plan',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.',
'highlights' => [
[
'title' => 'Key feature heading',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.',
],
[
'title' => 'Key feature heading',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.',
],
[
'title' => 'Key feature heading',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.',
],
],
'includesLabel' => 'Includes:',
'plan' => [
'name' => 'Basic plan',
'price' => '$19',
'period' => '/mo',
'description' => 'Lorem ipsum dolor sit amet',
'features' => [
'Feature text goes here',
'Feature text goes here',
'Feature text goes here',
'Feature text goes here',
'Feature text goes here',
'Feature text goes here',
'Feature text goes here',
'Feature text goes here',
'Feature text goes here',
'Feature text goes here',
],
'buttonLabel' => 'Get started',
'buttonHref' => null,
],
])
<section {{ $attributes->merge(['class' => 'bg-background px-[5%] py-16 text-foreground md:py-24 lg:py-28']) }}>
<div class="mx-auto max-w-7xl">
<div class="mb-12 max-w-3xl md:mb-18 lg:mb-20">
<p class="mb-3 font-semibold md:mb-4">{{ $tagline }}</p>
<h2 class="mb-5 text-4xl font-bold leading-[1.2] md:mb-6 md:text-5xl">{{ $heading }}</h2>
<p class="md:text-lg">{{ $description }}</p>
</div>
<div class="grid grid-cols-1 items-center gap-12 md:grid-cols-2 lg:gap-20">
<div class="flex flex-col gap-8 md:gap-6">
@foreach ($highlights as $highlight)
<div class="flex items-start gap-6">
@if (!empty($highlight['icon']))
{!! $highlight['icon'] !!}
@else
<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="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>
@endif
<div>
<h3 class="mb-3 text-lg font-bold leading-[1.4] md:text-xl">{{ $highlight['title'] ?? '' }}</h3>
<p>{{ $highlight['description'] ?? '' }}</p>
</div>
</div>
@endforeach
</div>
<x-ui.card class="py-6 md:py-8 md:[&>div]:px-8">
<div class="flex items-start justify-between gap-6">
<div>
<h3 class="mb-1 text-lg font-bold leading-[1.4] md:text-xl">{{ $plan['name'] ?? '' }}</h3>
<p>{{ $plan['description'] ?? '' }}</p>
</div>
<p class="shrink-0 font-bold">
<span class="text-4xl leading-[1.2] md:text-5xl">{{ $plan['price'] ?? '' }}</span><span
class="text-xl leading-[1.4] md:text-2xl">{{ $plan['period'] ?? '' }}</span>
</p>
</div>
<x-ui.separator class="my-6 md:my-8" />
<p>{{ $includesLabel }}</p>
<ul class="mt-4 grid grid-cols-1 gap-x-6 gap-y-4 py-2 lg:grid-cols-2">
@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>
<x-ui.separator class="my-6 md:my-8" />
<x-ui.button :href="$plan['buttonHref'] ?? null" size="lg"
class="w-full">{{ $plan['buttonLabel'] ?? 'Get started' }}</x-ui.button>
</x-ui.card>
</div>
</div>
</section>
Installation
php artisan ui:add-block pricing-05
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-05
/>.
1. Install component dependencies
php artisan ui:add button card separator
2. External packages
- composer:
gehrisandro/tailwind-merge-laravel
3.
Copy the block source into
resources/views/components/ui/
resources/views/components/ui/blocks/pricing-05.blade.php
{{--
Every piece of content is a prop, so you can drive this section from a CMS.
highlights is a list of ['title', 'description', 'icon'], where icon is an
optional '<svg ...>' string (the library mark when left out). plan is a
single ['name', 'price', 'period', 'description', 'features',
'buttonLabel', 'buttonHref'].
<x-ui.blocks.pricing-05
heading="One plan, everything in it"
:highlights="[
['title' => 'No seat limits', 'description' => 'Invite the whole team.'],
['title' => 'Cancel any time', 'description' => 'Monthly billing, no contract.'],
]"
:plan="[
'name' => 'Pro',
'price' => '$19',
'period' => '/mo',
'description' => 'Billed monthly',
'features' => ['Unlimited projects', 'Priority support', 'SSO'],
'buttonLabel' => 'Start trial',
'buttonHref' => '/register',
]"
/>
--}}
@props([
'tagline' => 'Tagline',
'heading' => 'Pricing plan',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.',
'highlights' => [
[
'title' => 'Key feature heading',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.',
],
[
'title' => 'Key feature heading',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.',
],
[
'title' => 'Key feature heading',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.',
],
],
'includesLabel' => 'Includes:',
'plan' => [
'name' => 'Basic plan',
'price' => '$19',
'period' => '/mo',
'description' => 'Lorem ipsum dolor sit amet',
'features' => [
'Feature text goes here',
'Feature text goes here',
'Feature text goes here',
'Feature text goes here',
'Feature text goes here',
'Feature text goes here',
'Feature text goes here',
'Feature text goes here',
'Feature text goes here',
'Feature text goes here',
],
'buttonLabel' => 'Get started',
'buttonHref' => null,
],
])
<section {{ $attributes->merge(['class' => 'bg-background px-[5%] py-16 text-foreground md:py-24 lg:py-28']) }}>
<div class="mx-auto max-w-7xl">
<div class="mb-12 max-w-3xl md:mb-18 lg:mb-20">
<p class="mb-3 font-semibold md:mb-4">{{ $tagline }}</p>
<h2 class="mb-5 text-4xl font-bold leading-[1.2] md:mb-6 md:text-5xl">{{ $heading }}</h2>
<p class="md:text-lg">{{ $description }}</p>
</div>
<div class="grid grid-cols-1 items-center gap-12 md:grid-cols-2 lg:gap-20">
<div class="flex flex-col gap-8 md:gap-6">
@foreach ($highlights as $highlight)
<div class="flex items-start gap-6">
@if (!empty($highlight['icon']))
{!! $highlight['icon'] !!}
@else
<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="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>
@endif
<div>
<h3 class="mb-3 text-lg font-bold leading-[1.4] md:text-xl">{{ $highlight['title'] ?? '' }}</h3>
<p>{{ $highlight['description'] ?? '' }}</p>
</div>
</div>
@endforeach
</div>
<x-ui.card class="py-6 md:py-8 md:[&>div]:px-8">
<div class="flex items-start justify-between gap-6">
<div>
<h3 class="mb-1 text-lg font-bold leading-[1.4] md:text-xl">{{ $plan['name'] ?? '' }}</h3>
<p>{{ $plan['description'] ?? '' }}</p>
</div>
<p class="shrink-0 font-bold">
<span class="text-4xl leading-[1.2] md:text-5xl">{{ $plan['price'] ?? '' }}</span><span
class="text-xl leading-[1.4] md:text-2xl">{{ $plan['period'] ?? '' }}</span>
</p>
</div>
<x-ui.separator class="my-6 md:my-8" />
<p>{{ $includesLabel }}</p>
<ul class="mt-4 grid grid-cols-1 gap-x-6 gap-y-4 py-2 lg:grid-cols-2">
@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>
<x-ui.separator class="my-6 md:my-8" />
<x-ui.button :href="$plan['buttonHref'] ?? null" size="lg"
class="w-full">{{ $plan['buttonLabel'] ?? 'Get started' }}</x-ui.button>
</x-ui.card>
</div>
</div>
</section>
Usage
Every piece of content is a prop, so you can drive this section from a CMS. highlights is a list of ['title', 'description', 'icon'], where icon is an optional '<svg ...>' string (the library mark when left out). plan is a single ['name', 'price', 'period', 'description', 'features', 'buttonLabel', 'buttonHref'].
<x-ui.blocks.pricing-05
heading="One plan, everything in it"
:highlights="[
['title' => 'No seat limits', 'description' => 'Invite the whole team.'],
['title' => 'Cancel any time', 'description' => 'Monthly billing, no contract.'],
]"
:plan="[
'name' => 'Pro',
'price' => '$19',
'period' => '/mo',
'description' => 'Billed monthly',
'features' => ['Unlimited projects', 'Priority support', 'SSO'],
'buttonLabel' => 'Start trial',
'buttonHref' => '/register',
]"
/>
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.',
'highlights' => [
[
'title' => 'Key feature heading',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.',
],
[
'title' => 'Key feature heading',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.',
],
[
'title' => 'Key feature heading',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.',
],
],
'includesLabel' => 'Includes:',
'plan' => [
'name' => 'Basic plan',
'price' => '$19',
'period' => '/mo',
'description' => 'Lorem ipsum dolor sit amet',
'features' => [
'Feature text goes here',
'Feature text goes here',
'Feature text goes here',
'Feature text goes here',
'Feature text goes here',
'Feature text goes here',
'Feature text goes here',
'Feature text goes here',
'Feature text goes here',
'Feature text goes here',
],
'buttonLabel' => 'Get started',
'buttonHref' => null,
],
])