Skip to content
Brok UI

Loading…

No results

FAQ

Open source

Frequently-asked-question sections — an accordion, a two-column split, a static grid and grouped categories.

Preview

8 of 8

resources/views/blocks/faq-editorial.blade.php Blade
@props([
    'eyebrow' => 'Support',
    'heading' => 'Questions, answered',
    'intro' => 'Everything you need to know before, during and after your order. Browse by topic — and reach out if anything is still unclear.',
    'contactText' => 'Still have a question?',
    'contactCta' => ['label' => 'Contact our team', 'href' => '#'],
    'categories' => null,
])

@php
    // Editorial, category-grouped FAQ. Sensible sample content so the block
    // renders fully with no arguments.
    $categories ??= [
        [
            'label' => 'Orders',
            'items' => [
                ['question' => 'Can I change or cancel my order?', 'answer' => 'Orders can be amended or cancelled within an hour of being placed. After that the order enters fulfilment and can no longer be edited — though a return is always available once it arrives.'],
                ['question' => 'Which payment methods do you accept?', 'answer' => 'Secure payments are taken via all major credit cards and the regional wallet options shown at checkout. An itemised receipt is emailed automatically with every order.'],
            ],
        ],
        [
            'label' => 'Shipping',
            'items' => [
                ['question' => 'Do you ship internationally?', 'answer' => 'Yes — orders are shipped worldwide. Shipping fees and delivery estimates are calculated at checkout, and a tracking link is sent the moment your parcel is dispatched.'],
                ['question' => 'How long will delivery take?', 'answer' => 'Standard delivery arrives within three to five business days. Express options are offered at checkout for next-day arrival in most regions.'],
            ],
        ],
        [
            'label' => 'Returns',
            'items' => [
                ['question' => 'What is your return policy?', 'answer' => 'Returns are accepted within fourteen days of delivery. Items must be unused and returned in their original condition, after which your refund is issued to the original payment method.'],
                ['question' => 'How do I start a return?', 'answer' => 'Open your order history, select the item and request a prepaid return label. Drop the parcel at any carrier point and we will handle the rest.'],
            ],
        ],
    ];

    // Per-instance id seed so several copies can coexist on one page.
    $uid = 'faq08-'.\Illuminate\Support\Str::random(6);
    // Open the first row by default.
@endphp

{{--
    faq-08 — "Editorial" Monogram FAQ section.
    Distinct sibling of the other FAQ compositions: a two-column editorial layout — a header
    column (uppercase wide-tracked eyebrow, large light `font-heading` heading,
    intro + contact line) beside a category-grouped accordion. Uppercase
    wide-tracked category labels, thin hairline dividers (<x-ui.separator>), lots
    of whitespace. Each category is a ghost-variant <x-ui.accordion>; the
    first question of the first category starts open.
    Composes <x-ui.accordion> and <x-ui.separator>.
    Semantic tokens only, logical spacing, WCAG AA, RTL-safe.
--}}
<section
    data-slot="faq-08"
    {{ $attributes->merge(['class' => 'bg-background py-20 text-foreground sm:py-28']) }}
>
    <div class="mx-auto max-w-6xl px-6 sm:px-8 lg:px-12">
        <div class="grid gap-12 lg:grid-cols-12 lg:gap-16">

            {{-- ── Editorial header column ── --}}
            <div class="lg:col-span-4">
                @if ($eyebrow)
                    <p class="font-body text-sm uppercase tracking-[0.3em] text-muted-foreground">
                        {{ __($eyebrow) }}
                    </p>
                @endif

                <h2 class="mt-4 text-balance font-heading text-3xl font-normal leading-tight tracking-tight sm:text-4xl">
                    {{ __($heading) }}
                </h2>

                @if ($intro)
                    <p class="mt-6 text-pretty font-body leading-relaxed text-muted-foreground">
                        {{ __($intro) }}
                    </p>
                @endif

                @if ($contactText || $contactCta)
                    <p class="mt-8 font-body text-sm text-muted-foreground">
                        @if ($contactText)
                            {{ __($contactText) }}
                        @endif
                        @if ($contactCta)
                            <a
                                href="{{ $contactCta['href'] }}"
                                class="font-medium text-foreground underline decoration-border underline-offset-4 transition-colors hover:decoration-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
                            >
                                {{ __($contactCta['label']) }}
                            </a>
                        @endif
                    </p>
                @endif
            </div>

            {{-- ── Category-grouped accordion column ── --}}
            <div class="lg:col-span-8">
                @foreach ($categories as $c => $category)
                    <div class="mt-12 first:mt-0">
                        {{-- Category label --}}
                        <h3 class="font-body text-sm uppercase tracking-widest text-muted-foreground">
                            {{ __($category['label']) }}
                        </h3>

                        <x-ui.separator class="mt-4" />

                        <x-ui.accordion variant="ghost" :inset="false" :default="$c === 0 ? $uid.'-0-0' : null" class="border-b border-border/60">
                            @foreach ($category['items'] as $i => $item)
                                <x-ui.accordion.item :value="$uid.'-'.$c.'-'.$i">
                                    <x-ui.accordion.trigger class="!py-6 font-body !text-base leading-snug [&_svg]:size-5">
                                        {{ __($item['question']) }}
                                    </x-ui.accordion.trigger>
                                    <x-ui.accordion.content class="font-body !text-base">
                                        <p class="pb-2 pe-10 text-pretty leading-relaxed">{{ __($item['answer']) }}</p>
                                    </x-ui.accordion.content>
                                </x-ui.accordion.item>
                            @endforeach
                        </x-ui.accordion>
                    </div>
                @endforeach
            </div>
        </div>
    </div>
</section>

Installation

terminal
php artisan ui:add blocks/faq-editorial

Installs these dependencies automatically:

Registry contract

Install confidence

php artisan ui:add blocks/faq-editorial writes only the generated targets below. The CLI validates each file hash before writing and prompts before replacing local changes unless --force is used.

Version
1.0.5
License
open
Stability
stable
Contract
v1
Foundation
≥ 1.0.0
Type Generated target
blade resources/views/blocks/faq-editorial.blade.php

Registry dependencies

accordion separator

Package dependencies

composer: jml/brok:^0.2

npm: alpinejs

Use with AI

A brief for your coding agent: what the block is, the install command, how to render it, its props and the rules. Copy it, or open a prompt about this block in an assistant.

faq-editorial.md
# Brok UI block: FAQ Editorial (`faq-editorial`)

An editorial, category-grouped FAQ section — a header column (eyebrow, large light display heading, intro and contact line) beside an inline Alpine accordion of question rows separated by thin hairline dividers, with uppercase wide-tracked category labels.

Brok UI is a Laravel Blade registry. `ui:add` copies this block into the app as plain Blade the app owns; it composes installed `<brok:*>` primitives and semantic design tokens.

## Install

```bash
php artisan ui:add blocks/faq-editorial
```

## Render it

```blade
<x-blocks.faq-editorial />
```

## Props

- `eyebrow` (string, default `Support`)
- `heading` (string, default `Questions, answered`)
- `intro` (string, default `Everything you need to know before, during and after your order. Browse by topic — and reach out if anything is still unclear.`)
- `contact-text` (string, default `Still have a question?`)
- `contact-cta` (array, default `['label' => 'Contact our team', 'href' => '#']`)
- `categories` (mixed|null, default `null`)

## Use when

- Presenting a category-grouped FAQ in an editorial layout: a header column beside an accordion of hairline-divided question rows.
- Pairing uppercase wide-tracked category labels with a lighter, display-heading intro.

## Avoid when

- Use faq-categories for a plainer grouped-category FAQ without the editorial header treatment.

## Rules

- Render the installed block with `<x-blocks.faq-editorial />` and pass data through its props; edit the copied file only for structural changes.
- Keep the semantic design tokens (`bg-background`, `text-muted-foreground`); never swap in raw colour utilities.
- Keep the `data-slot` attributes and the logical (start/end) spacing so the markup still mirrors under `dir="rtl"`.

## Links

- Docs: https://brokui.dev/blocks/faq-editorial
- Registry JSON (files, props, contract): https://brokui.dev/r/open/blocks/faq-editorial.json

Working in Claude Code, Cursor or Codex? Give the agent the whole registry through the MCP server or the Brok UI skill.

Guidance

Use when

  • Presenting a category-grouped FAQ in an editorial layout: a header column beside an accordion of hairline-divided question rows.
  • Pairing uppercase wide-tracked category labels with a lighter, display-heading intro.

Avoid when

  • Use faq-categories for a plainer grouped-category FAQ without the editorial header treatment.

Anti-patterns

  • Do not replace semantic props with conflicting utility classes.
  • Do not remove labels, focus styles, or state attributes.
Anatomy
root faq-08

Usage

Render the block as a component, passing data where useful:

resources/views/welcome.blade.php Blade
<x-blocks.faq-editorial />

Built from primitives

Composes <brok:*> Semantic tokens Re-themeable RTL-ready

This block composes installed <brok:*> primitives and semantic design tokens only — it does not reimplement any primitive. Re-theme it (light, dark, admin, customer) by editing CSS variables; flip the preview to RTL to confirm it mirrors.

Source

The exact, editable file ui:add writes into your app. The preview above renders this same source — there are no preview-only blocks.

resources/views/blocks/faq-editorial.blade.php Blade
@props([
    'eyebrow' => 'Support',
    'heading' => 'Questions, answered',
    'intro' => 'Everything you need to know before, during and after your order. Browse by topic — and reach out if anything is still unclear.',
    'contactText' => 'Still have a question?',
    'contactCta' => ['label' => 'Contact our team', 'href' => '#'],
    'categories' => null,
])

@php
    // Editorial, category-grouped FAQ. Sensible sample content so the block
    // renders fully with no arguments.
    $categories ??= [
        [
            'label' => 'Orders',
            'items' => [
                ['question' => 'Can I change or cancel my order?', 'answer' => 'Orders can be amended or cancelled within an hour of being placed. After that the order enters fulfilment and can no longer be edited — though a return is always available once it arrives.'],
                ['question' => 'Which payment methods do you accept?', 'answer' => 'Secure payments are taken via all major credit cards and the regional wallet options shown at checkout. An itemised receipt is emailed automatically with every order.'],
            ],
        ],
        [
            'label' => 'Shipping',
            'items' => [
                ['question' => 'Do you ship internationally?', 'answer' => 'Yes — orders are shipped worldwide. Shipping fees and delivery estimates are calculated at checkout, and a tracking link is sent the moment your parcel is dispatched.'],
                ['question' => 'How long will delivery take?', 'answer' => 'Standard delivery arrives within three to five business days. Express options are offered at checkout for next-day arrival in most regions.'],
            ],
        ],
        [
            'label' => 'Returns',
            'items' => [
                ['question' => 'What is your return policy?', 'answer' => 'Returns are accepted within fourteen days of delivery. Items must be unused and returned in their original condition, after which your refund is issued to the original payment method.'],
                ['question' => 'How do I start a return?', 'answer' => 'Open your order history, select the item and request a prepaid return label. Drop the parcel at any carrier point and we will handle the rest.'],
            ],
        ],
    ];

    // Per-instance id seed so several copies can coexist on one page.
    $uid = 'faq08-'.\Illuminate\Support\Str::random(6);
    // Open the first row by default.
@endphp

{{--
    faq-08 — "Editorial" Monogram FAQ section.
    Distinct sibling of the other FAQ compositions: a two-column editorial layout — a header
    column (uppercase wide-tracked eyebrow, large light `font-heading` heading,
    intro + contact line) beside a category-grouped accordion. Uppercase
    wide-tracked category labels, thin hairline dividers (<x-ui.separator>), lots
    of whitespace. Each category is a ghost-variant <x-ui.accordion>; the
    first question of the first category starts open.
    Composes <x-ui.accordion> and <x-ui.separator>.
    Semantic tokens only, logical spacing, WCAG AA, RTL-safe.
--}}
<section
    data-slot="faq-08"
    {{ $attributes->merge(['class' => 'bg-background py-20 text-foreground sm:py-28']) }}
>
    <div class="mx-auto max-w-6xl px-6 sm:px-8 lg:px-12">
        <div class="grid gap-12 lg:grid-cols-12 lg:gap-16">

            {{-- ── Editorial header column ── --}}
            <div class="lg:col-span-4">
                @if ($eyebrow)
                    <p class="font-body text-sm uppercase tracking-[0.3em] text-muted-foreground">
                        {{ __($eyebrow) }}
                    </p>
                @endif

                <h2 class="mt-4 text-balance font-heading text-3xl font-normal leading-tight tracking-tight sm:text-4xl">
                    {{ __($heading) }}
                </h2>

                @if ($intro)
                    <p class="mt-6 text-pretty font-body leading-relaxed text-muted-foreground">
                        {{ __($intro) }}
                    </p>
                @endif

                @if ($contactText || $contactCta)
                    <p class="mt-8 font-body text-sm text-muted-foreground">
                        @if ($contactText)
                            {{ __($contactText) }}
                        @endif
                        @if ($contactCta)
                            <a
                                href="{{ $contactCta['href'] }}"
                                class="font-medium text-foreground underline decoration-border underline-offset-4 transition-colors hover:decoration-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
                            >
                                {{ __($contactCta['label']) }}
                            </a>
                        @endif
                    </p>
                @endif
            </div>

            {{-- ── Category-grouped accordion column ── --}}
            <div class="lg:col-span-8">
                @foreach ($categories as $c => $category)
                    <div class="mt-12 first:mt-0">
                        {{-- Category label --}}
                        <h3 class="font-body text-sm uppercase tracking-widest text-muted-foreground">
                            {{ __($category['label']) }}
                        </h3>

                        <x-ui.separator class="mt-4" />

                        <x-ui.accordion variant="ghost" :inset="false" :default="$c === 0 ? $uid.'-0-0' : null" class="border-b border-border/60">
                            @foreach ($category['items'] as $i => $item)
                                <x-ui.accordion.item :value="$uid.'-'.$c.'-'.$i">
                                    <x-ui.accordion.trigger class="!py-6 font-body !text-base leading-snug [&_svg]:size-5">
                                        {{ __($item['question']) }}
                                    </x-ui.accordion.trigger>
                                    <x-ui.accordion.content class="font-body !text-base">
                                        <p class="pb-2 pe-10 text-pretty leading-relaxed">{{ __($item['answer']) }}</p>
                                    </x-ui.accordion.content>
                                </x-ui.accordion.item>
                            @endforeach
                        </x-ui.accordion>
                    </div>
                @endforeach
            </div>
        </div>
    </div>
</section>

Ownership & lifecycle

Owner, release state, review evidence and adoption for this item.
Owner
Platform UI (@JoshJML)
Current version
1.0.5
Status
Stable
License
open
Deprecation
Not deprecated
Contract
v1
Foundation
≥ 1.0.0