انتقل إلى المحتوى
الأدلة
التنقل
التنبيهات
الطبقات العائمة
التخطيط
عرض البيانات
النماذج
.md

الأسعار

pricing-02

جدول مقارنة لخطتين: رؤوس الخطط مع السعر والزر، ثم صفوف الميزات مجمعة حسب الفئة مع علامات صح أو قيم في خلايا بحدود.

فتح بملء الشاشة

التثبيت

php artisan ui:add-block pricing-02

أمر واحد يثبّت ملف Blade الخاص بالقالب وكل مكوّن يعتمد عليه. اعرضه في تخطيطك كالتالي <x-ui.blocks.pricing-02 />.

المكونات المضمّنة

الاستخدام

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']. 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.

<x-ui.blocks.pricing-02
    heading="Compare plans"
    :plans="[
        ['name' => 'Starter', 'price' => '$9', 'period' => 'Per month', 'buttonHref' => '/register'],
        ['name' => 'Team', 'price' => '$29', 'period' => 'Per month', 'buttonHref' => '/register?plan=team'],
    ]"
    :categories="[
        ['title' => 'Usage', 'features' => [
            ['label' => 'Seats', 'values' => ['3', '20']],
            ['label' => 'Custom domains', 'values' => [false, true]],
        ]],
    ]"
/>

الخصائص

كل خاصية مع قيمتها الافتراضية. مرّر أيًّا منها كسمة، واستخدم : لربط قيمة PHP.

@props([
    'tagline' => 'Tagline',
    'heading' => 'Pricing plan',
    'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
    'plans' => [
        [
            'name' => 'Basic',
            'price' => '$19',
            'period' => 'Per month',
            'description' => 'Lorem ipsum dolor sit amet',
            'buttonLabel' => 'Get started',
            'buttonHref' => null,
        ],
        [
            'name' => 'Business',
            'price' => '$29',
            'period' => 'Per month',
            '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',
])