--- title: "pricing-04" description: "Borderless two-plan comparison table with centred plan headers, feature rows grouped by category and buttons above and below." category: "Pricing" --- # pricing-04 Borderless two-plan comparison table with centred plan headers, feature rows grouped by category and buttons above and below. ## Installation ```bash php artisan ui:add-block pricing-04 ``` ## Dependencies - composer: `gehrisandro/tailwind-merge-laravel` - component: [button](https://laralcn-ui.abdulkadersafi.com/components/button.md) — the CLI installs it for you. - component: [table](https://laralcn-ui.abdulkadersafi.com/components/table.md) — the CLI installs it for you. ## Source `resources/views/components/ui/blocks/pricing-04.blade.php` ```blade {{-- Every piece of content is a prop, so you can drive this section from a CMS. A plan is ['name', 'price', 'period', 'description', 'buttonLabel', 'buttonHref']; its button shows above and again below the table. Each feature row carries one value per plan, in plan order: true draws a check, false or null leaves the cell empty, and a string ('10', 'Unlimited') is printed as is. --}} @props([ 'tagline' => 'Tagline', 'heading' => 'Pricing plan', 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'plans' => [ [ 'name' => 'Basic', 'price' => '$19', 'period' => '/mo', 'description' => 'Lorem ipsum dolor sit amet', 'buttonLabel' => 'Get started', 'buttonHref' => null, ], [ 'name' => 'Business', 'price' => '$29', 'period' => '/mo', 'description' => 'Lorem ipsum dolor sit amet', 'buttonLabel' => 'Get started', 'buttonHref' => null, ], ], 'categories' => [ [ 'title' => 'Feature Category', 'features' => [ ['label' => 'Feature text goes here', 'values' => ['10', '25']], ['label' => 'Feature text goes here', 'values' => [true, true]], ['label' => 'Feature text goes here', 'values' => [true, true]], ['label' => 'Feature text goes here', 'values' => [false, true]], ], ], [ 'title' => 'Feature Category', 'features' => [ ['label' => 'Feature text goes here', 'values' => ['10', '25']], ['label' => 'Feature text goes here', 'values' => [true, true]], ['label' => 'Feature text goes here', 'values' => [true, true]], ['label' => 'Feature text goes here', 'values' => [false, true]], ], ], [ 'title' => 'Feature Category', 'features' => [ ['label' => 'Feature text goes here', 'values' => ['10', '25']], ['label' => 'Feature text goes here', 'values' => [true, true]], ['label' => 'Feature text goes here', 'values' => [true, true]], ['label' => 'Feature text goes here', 'values' => [false, true]], ], ], ], 'includedLabel' => 'Included', 'excludedLabel' => 'Not included', ]) @php // The label column is hidden on phones, where each feature gets a // full-width row of its own above its values. A colspan wider than the // visible columns would add an empty column, so phones span one less. $span = count($plans) + 1; @endphp
merge(['class' => 'bg-background px-[5%] py-16 text-foreground md:py-24 lg:py-28']) }}>

{{ $tagline }}

{{ $heading }}

{{ $description }}

@foreach ($plans as $plan)
{{ $plan['name'] ?? '' }} {{ $plan['price'] ?? '' }}{{ $plan['period'] ?? '' }} {{ $plan['description'] ?? '' }} {{ $plan['buttonLabel'] ?? 'Get started' }}
@endforeach @foreach ($categories as $category) {{ $category['title'] ?? '' }} {{ $category['title'] ?? '' }} @foreach ($category['features'] ?? [] as $feature) {{ $feature['label'] ?? '' }} {{ $feature['label'] ?? '' }} @foreach ($feature['values'] ?? [] as $value) @if ($value === true) {{ $includedLabel }} @elseif ($value === false || $value === null) {{ $excludedLabel }} @else {{ $value }} @endif @endforeach @endforeach @endforeach @foreach ($plans as $plan) {{ $plan['buttonLabel'] ?? 'Get started' }} @endforeach
```