---
title: "faq-01"
description: "Centred FAQ: title, an accordion of questions and a \"Still have questions?\" contact prompt below."
category: "FAQ"
---
# faq-01
Centred FAQ: title, an accordion of questions and a "Still have questions?" contact prompt below.
## Installation
```bash
php artisan ui:add-block faq-01
```
## Dependencies
- composer: `gehrisandro/tailwind-merge-laravel`
- component: [accordion](https://laralcn-ui.abdulkadersafi.com/ar/components/accordion.md) — the CLI installs it for you.
- component: [button](https://laralcn-ui.abdulkadersafi.com/ar/components/button.md) — the CLI installs it for you.
## Source
`resources/views/components/ui/blocks/faq-01.blade.php`
```blade
{{--
Centred FAQ: title block, an accordion of questions and a "Still have
questions?" contact prompt underneath. 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, 5, [
'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 $i => $item)
{{ $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
```