--- title: "faq-10" description: "Left-aligned FAQ with questions and answers always open in a three-column grid, plus a contact prompt." category: "FAQ" --- # faq-10 Left-aligned FAQ with questions and answers always open in a three-column grid, plus a contact prompt. ## Installation ```bash php artisan ui:add-block faq-10 ``` ## Dependencies - composer: `gehrisandro/tailwind-merge-laravel` - component: [button](https://laralcn-ui.abdulkadersafi.com/ar/components/button.md) — the CLI installs it for you. ## Source `resources/views/components/ui/blocks/faq-10.blade.php` ```blade {{-- Left-aligned FAQ with questions and answers always open in a grid (three columns on desktop) and a "Still have questions?" prompt. Every piece of content is a prop. Each item is ['question' => ..., 'answer' => ...]. Set :schema="true" to print FAQPage JSON-LD for search engines. --}} @props([ 'heading' => 'FAQs', 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.', 'items' => array_fill(0, 6, [ 'question' => 'Question text goes here', 'answer' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.', ]), 'ctaHeading' => 'Still have questions?', 'ctaText' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'ctaLabel' => 'Contact', 'ctaHref' => '#', 'schema' => false, ])
merge(['class' => 'w-full bg-background px-[5%] py-16 text-foreground md:py-24 lg:py-28']) }}>

{{ $heading }}

{{ $description }}

@foreach ($items as $item)
{{ $item['question'] ?? '' }}
{{ $item['answer'] ?? '' }}
@endforeach

{{ $ctaHeading }}

{{ $ctaText }}

{{ $ctaLabel }}
@if ($schema) @php // Built in a php block: Blade would read the '@context' key below as a directive anywhere else. $faqSchema = [ '@context' => 'https://schema.org', '@type' => 'FAQPage', 'mainEntity' => array_map(fn ($item) => [ '@type' => 'Question', 'name' => $item['question'] ?? '', 'acceptedAnswer' => ['@type' => 'Answer', 'text' => $item['answer'] ?? ''], ], array_values($items)), ]; @endphp @endif
```