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

الأسعار

pricing-08

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

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

التثبيت

php artisan ui:add-block pricing-08

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

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

الاستخدام

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', 'description', 'buttonLabel', 'buttonHref']. The switch is the tabs component, so each period renders its own copy of 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.

<x-ui.blocks.pricing-08
    heading="Compare plans"
    :periods="['monthly' => 'Monthly', 'yearly' => 'Yearly (save 20%)']"
    :plans="[
        'monthly' => [
            ['name' => 'Starter', 'price' => '$9', 'period' => 'Per month', 'buttonHref' => '/register'],
            ['name' => 'Team', 'price' => '$29', 'period' => 'Per month', 'buttonHref' => '/register?plan=team'],
        ],
        'yearly' => [
            ['name' => 'Starter', 'price' => '$86', 'period' => 'Per year', 'buttonHref' => '/register?yearly=1'],
            ['name' => 'Team', 'price' => '$278', 'period' => 'Per year', 'buttonHref' => '/register?plan=team&yearly=1'],
        ],
    ]"
    :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.',
    'periods' => ['monthly' => 'Monthly', 'yearly' => 'Yearly'],
    'plans' => [
        'monthly' => [
            [
                'name' => 'Free',
                'price' => '$0',
                'period' => 'Per month',
                'description' => 'Lorem ipsum dolor sit amet',
                'buttonLabel' => 'Get started',
                'buttonHref' => null,
            ],
            [
                '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,
            ],
            [
                'name' => 'Enterprise',
                'price' => '$49',
                'period' => 'Per month',
                'description' => 'Lorem ipsum dolor sit amet',
                'buttonLabel' => 'Get started',
                'buttonHref' => null,
            ],
        ],
        'yearly' => [
            [
                'name' => 'Free',
                'price' => '$0',
                'period' => 'Per year',
                'description' => 'Lorem ipsum dolor sit amet',
                'buttonLabel' => 'Get started',
                'buttonHref' => null,
            ],
            [
                'name' => 'Basic',
                'price' => '$190',
                'period' => 'Per year',
                'description' => 'Lorem ipsum dolor sit amet',
                'buttonLabel' => 'Get started',
                'buttonHref' => null,
            ],
            [
                'name' => 'Business',
                'price' => '$290',
                'period' => 'Per year',
                'description' => 'Lorem ipsum dolor sit amet',
                'buttonLabel' => 'Get started',
                'buttonHref' => null,
            ],
            [
                'name' => 'Enterprise',
                'price' => '$490',
                'period' => 'Per year',
                'description' => 'Lorem ipsum dolor sit amet',
                'buttonLabel' => 'Get started',
                'buttonHref' => null,
            ],
        ],
    ],
    'categories' => [
        [
            'title' => 'Feature Category',
            'features' => [
                ['label' => 'Feature text goes here', 'values' => ['10', '10', '25', 'Unlimited']],
                ['label' => 'Feature text goes here', 'values' => [true, true, true, true]],
                ['label' => 'Feature text goes here', 'values' => [true, true, true, true]],
                ['label' => 'Feature text goes here', 'values' => [false, false, true, true]],
                ['label' => 'Feature text goes here', 'values' => [false, false, false, true]],
            ],
        ],
        [
            'title' => 'Feature Category',
            'features' => [
                ['label' => 'Feature text goes here', 'values' => ['10', '10', '25', 'Unlimited']],
                ['label' => 'Feature text goes here', 'values' => [true, true, true, true]],
                ['label' => 'Feature text goes here', 'values' => [true, true, true, true]],
                ['label' => 'Feature text goes here', 'values' => [false, false, true, true]],
                ['label' => 'Feature text goes here', 'values' => [false, false, false, true]],
            ],
        ],
        [
            'title' => 'Feature Category',
            'features' => [
                ['label' => 'Feature text goes here', 'values' => ['10', '10', '25', 'Unlimited']],
                ['label' => 'Feature text goes here', 'values' => [true, true, true, true]],
                ['label' => 'Feature text goes here', 'values' => [true, true, true, true]],
                ['label' => 'Feature text goes here', 'values' => [false, false, true, true]],
                ['label' => 'Feature text goes here', 'values' => [false, false, false, true]],
            ],
        ],
    ],
    'includedLabel' => 'Included',
    'excludedLabel' => 'Not included',
])