Ask AI about this page

Introduction

The Accordion component is a collapsible content component designed to organize information in an expandable format. It allows users to show and hide sections of related content, making it perfect for FAQs, product details, settings panels, and other scenarios where space-efficient content organization is needed.

Installation

Use the fluxtor artisan command to install the accordion component easily:

php artisan fluxtor:install accordion

Once installed, you can use the <x-ui.accordion />, <x-ui.accordion.item />, <x-ui.accordion.trigger />, and <x-ui.accordion.content /> components in any Blade view.

Usage

Basic Accordion

We offer a 30-day return policy for all unused items in their original packaging. Simply contact our customer service team to initiate a return.

Standard shipping typically takes 3-5 business days, while express shipping takes 1-2 business days. International orders may take 7-14 business days depending on the destination.

Yes, we ship to over 50 countries worldwide. Shipping costs and delivery times vary by destination. You can see the exact cost and estimated delivery time at checkout.

<x-ui.accordion>
    <x-ui.accordion.item>
        <x-ui.accordion.trigger>
            What is your return policy?
        </x-ui.accordion.trigger>
        <x-ui.accordion.content>
            <p>We offer a 30-day return policy for all unused items in their original packaging. Simply contact our customer service team to initiate a return.</p>
        </x-ui.accordion.content>
    </x-ui.accordion.item>

    <x-ui.accordion.item>
        <x-ui.accordion.trigger>
            How long does shipping take?
        </x-ui.accordion.trigger>
        <x-ui.accordion.content>
            <p>Standard shipping typically takes 3-5 business days, while express shipping takes 1-2 business days.</p>
        </x-ui.accordion.content>
    </x-ui.accordion.item>
</x-ui.accordion>

Shorthand Syntax

For simple accordions, you can use the shorthand syntax with the trigger prop.

Manage your account preferences, update your profile information, and configure notification settings.

Email notifications Enabled
Two-factor authentication Enabled

Control your privacy settings and security preferences to keep your account safe.

  • Password requirements
  • Login history
  • Data sharing preferences
<x-ui.accordion>
    <x-ui.accordion.item trigger="Account Settings">
        <p>Manage your account preferences, update your profile information, and configure notification settings.</p>
        <div class="mt-3 space-y-2">
            <div class="flex items-center justify-between">
                <span>Email notifications</span>
                <span class="text-green-600">Enabled</span>
            </div>
            <div class="flex items-center justify-between">
                <span>Two-factor authentication</span>
                <span class="text-green-600">Enabled</span>
            </div>
        </div>
    </x-ui.accordion.item>

    <x-ui.accordion.item trigger="Privacy & Security">
        <p>Control your privacy settings and security preferences to keep your account safe.</p>
        <ul class="mt-3 space-y-1 list-disc list-inside">
            <li>Password requirements</li>
            <li>Login history</li>
            <li>Data sharing preferences</li>
        </ul>
    </x-ui.accordion.item>
</x-ui.accordion>

Expanded by Default

Set an accordion item to be expanded when the component loads.

Welcome! This section is expanded by default to help you get started quickly.

💡 Tip: Use the expanded prop to open important sections by default.

Explore advanced features and customization options for power users.

Common issues and solutions to help you resolve problems quickly.

<x-ui.accordion>
    <x-ui.accordion.item 
        expanded
        trigger="Getting Started">
        <p>Welcome! This section is expanded by default to help you get started quickly.</p>
        <div class="mt-3 p-3 bg-blue-50 dark:bg-blue-900/20 rounded">
            <p class="text-sm">💡 <strong>Tip:</strong> Use the <code>expanded</code> prop to open important sections by default.</p>
        </div>
    </x-ui.accordion.item>

    <x-ui.accordion.item trigger="Advanced Features">
        <p>Explore advanced features and customization options for power users.</p>
    </x-ui.accordion.item>
</x-ui.accordion>

Disabled Items

Disable specific accordion items to prevent user interaction.

These features are currently available and ready to use.

  • User management
  • Basic reporting
  • Email notifications

This content is not yet available.

Access comprehensive documentation and guides for all features.

<x-ui.accordion>
    //
    <x-ui.accordion.item 
        disabled 
        trigger="Premium Features (Coming Soon)">
        <p>This content is not yet available.</p>
    </x-ui.accordion.item>
    //
</x-ui.accordion>

Reverse Layout

Use the reverse layout to position chevron icons on the left side.

Minimum Requirements:

  • 4GB RAM
  • 2GB available storage
  • Internet connection

Recommended:

  • 8GB RAM or more
  • 5GB available storage
  • High-speed internet

Desktop

  • Windows 10+
  • macOS 10.15+
  • Linux (Ubuntu 18+)

Mobile

  • iOS 13+
  • Android 8+
<x-ui.accordion reverse>
    //..
</x-ui.accordion>

Component Props Reference

Accordion Props

Prop Type Default Description
reverse boolean false Whether to reverse the trigger layout (chevron on left)

Accordion Item Props

Prop Type Default Description
disabled boolean false Whether the accordion item is disabled
trigger string null Shorthand trigger content (alternative to using trigger slot)
expanded boolean false Whether the item is expanded by default

Inherited Props (Accordion Item)

These props are automatically inherited from the parent accordion component:

Prop Type Default Description
reverse boolean false Reverse layout inherited from parent accordion

Accordion Item Trigger Props

Prop Type Description
disabled boolean Disabled state inherited from parent item
reverse boolean Reverse layout inherited from accordion

© FLuxtor Copyright 2024-2025. All rights reserved.