--- title: "pricing-09" description: "Monthly\/yearly switch (tabs) over two centred pricing cards, each with a price, a checked feature list and a full-width button." category: "Pricing" --- # pricing-09 Monthly/yearly switch (tabs) over two centred pricing cards, each with a price, a checked feature list and a full-width button. ## Installation ```bash php artisan ui:add-block pricing-09 ``` ## Dependencies - composer: `gehrisandro/tailwind-merge-laravel` - component: [button](https://laralcn-ui.abdulkadersafi.com/components/button.md) — the CLI installs it for you. - component: [card](https://laralcn-ui.abdulkadersafi.com/components/card.md) — the CLI installs it for you. - component: [tabs](https://laralcn-ui.abdulkadersafi.com/components/tabs.md) — the CLI installs it for you. ## Source `resources/views/components/ui/blocks/pricing-09.blade.php` ```blade {{-- Every piece of content is a prop, so you can drive this section from a CMS. periods labels the switch (key => label), and plans holds one list of plans per period key. A plan is ['name', 'price', 'period', 'features', 'buttonLabel', 'buttonHref']. The switch is the tabs component. --}} @props([ 'tagline' => 'Tagline', 'heading' => 'Pricing plan', 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'periods' => ['monthly' => 'Monthly', 'yearly' => 'Yearly'], 'plans' => [ 'monthly' => [ [ 'name' => 'Basic plan', 'price' => '$19', 'period' => '/mo', 'features' => ['Feature text goes here', 'Feature text goes here', 'Feature text goes here'], 'buttonLabel' => 'Get started', 'buttonHref' => null, ], [ 'name' => 'Business plan', 'price' => '$29', 'period' => '/mo', 'features' => [ '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, ], ], 'yearly' => [ [ 'name' => 'Basic plan', 'price' => '$190', 'period' => '/yr', 'features' => ['Feature text goes here', 'Feature text goes here', 'Feature text goes here'], 'buttonLabel' => 'Get started', 'buttonHref' => null, ], [ 'name' => 'Business plan', 'price' => '$290', 'period' => '/yr', 'features' => [ '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, ], ], ], ]) merge(['class' => 'bg-background px-[5%] py-16 text-foreground md:py-24 lg:py-28']) }}> {{ $tagline }} {{ $heading }} {{ $description }} @foreach ($periods as $period => $label) @foreach ($plans[$period] ?? [] as $plan) {{ $plan['name'] ?? '' }} {{ $plan['price'] ?? '' }}{{ $plan['period'] ?? '' }} @foreach ($plan['features'] ?? [] as $feature) {{ $feature }} @endforeach {{ $plan['buttonLabel'] ?? 'Get started' }} @endforeach @endforeach ```
{{ $tagline }}
{{ $description }}
{{ $plan['price'] ?? '' }}{{ $plan['period'] ?? '' }}