--- title: "pricing-11" description: "Centred heading and Monthly \/ Yearly tabs over two plan cards: name, price, button, then a feature list." category: "Pricing" --- # pricing-11 Centred heading and Monthly / Yearly tabs over two plan cards: name, price, button, then a feature list. ## Installation ```bash php artisan ui:add-block pricing-11 ``` ## 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-11.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.', 'monthlyLabel' => 'Monthly', 'yearlyLabel' => 'Yearly', 'plans' => [ [ '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, 5, 'Feature text goes here'), ], ], ])
merge(['class' => 'w-full bg-background px-[5%] py-16 text-foreground md:py-24 lg:py-28']) }}>
@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
```