--- title: "pricing-18" description: "Four plan cards (name, price, button, features) with Monthly \/ Yearly tabs beside a left-aligned heading." category: "Pricing" --- # pricing-18 Four plan cards (name, price, button, features) with Monthly / Yearly tabs beside a left-aligned heading. ## Installation ```bash php artisan ui:add-block pricing-18 ``` ## Dependencies - composer: `gehrisandro/tailwind-merge-laravel` - component: [button](https://laralcn-ui.abdulkadersafi.com/ar/components/button.md) — the CLI installs it for you. - component: [card](https://laralcn-ui.abdulkadersafi.com/ar/components/card.md) — the CLI installs it for you. - component: [separator](https://laralcn-ui.abdulkadersafi.com/ar/components/separator.md) — the CLI installs it for you. - component: [tabs](https://laralcn-ui.abdulkadersafi.com/ar/components/tabs.md) — the CLI installs it for you. ## Source `resources/views/components/ui/blocks/pricing-18.blade.php` ```blade {{-- 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. --}} @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', 'plans' => [ [ 'name' => 'Free plan', 'description' => 'Lorem ipsum dolor sit amet', 'price' => '$0', 'period' => '/mo', 'yearlyPrice' => '$0', 'yearlyPeriod' => '/yr', 'buttonLabel' => 'Get started', 'buttonHref' => null, 'features' => array_fill(0, 3, 'Feature text goes here'), ], [ 'name' => 'Basic plan', 'description' => 'Lorem ipsum dolor sit amet', 'price' => '$19', 'period' => '/mo', 'yearlyPrice' => '$199', 'yearlyPeriod' => '/yr', 'buttonLabel' => 'Get started', 'buttonHref' => null, 'features' => array_fill(0, 3, 'Feature text goes here'), ], [ 'name' => 'Business plan', 'description' => 'Lorem ipsum dolor sit amet', 'price' => '$29', 'period' => '/mo', 'yearlyPrice' => '$299', 'yearlyPeriod' => '/yr', 'buttonLabel' => 'Get started', 'buttonHref' => null, 'features' => array_fill(0, 4, 'Feature text goes here'), ], [ 'name' => 'Enterprise plan', 'description' => 'Lorem ipsum dolor sit amet', 'price' => '$49', 'period' => '/mo', 'yearlyPrice' => '$499', 'yearlyPeriod' => '/yr', 'buttonLabel' => 'Get started', 'buttonHref' => null, 'features' => array_fill(0, 5, 'Feature text goes here'), ], ], ]) 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. --}} @if ($tagline) {{ $tagline }} @endif {{ $heading }} @if ($description) {{ $description }} @endif @foreach (['monthly', 'yearly'] as $billing) @foreach ($plans as $plan) @php $price = $billing === 'yearly' ? $plan['yearlyPrice'] ?? '' : $plan['price'] ?? ''; $period = $billing === 'yearly' ? $plan['yearlyPeriod'] ?? '' : $plan['period'] ?? ''; @endphp {{ $plan['name'] ?? '' }} @if (!empty($plan['description'])) {{ $plan['description'] }} @endif {{ $price }}{{ $period }} {{ $plan['buttonLabel'] ?? 'Get started' }} @foreach ($plan['features'] ?? [] as $feature) {{ $feature }} @endforeach @endforeach @endforeach ```
{{ $tagline }}
{{ $description }}
{{ $plan['description'] }}
{{ $price }}{{ $period }}