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

3 of 8

resources/views/blocks/faq-grid.blade.php Blade
@props([
    'eyebrow' => 'FAQ',
    'heading' => 'Frequently asked questions',
    'subheading' => 'Can’t find the answer you’re looking for? Reach out to our team and we’ll get back to you.',
    'items' => null,
])

@php
    $items ??= [
        ['question' => 'Do I own the installed code?', 'answer' => 'Yes. Components and blocks are copied into your project as plain Blade. There is no runtime lock-in — edit anything you like.'],
        ['question' => 'How do updates work?', 'answer' => 'Run the update command to pull upstream changes. Unedited files update automatically; edited files are never overwritten and produce a reviewable diff.'],
        ['question' => 'Can I theme it?', 'answer' => 'The entire system is driven by CSS design tokens. Re-theme light, dark, and per-surface variants by editing variables only.'],
        ['question' => 'Is it accessible?', 'answer' => 'Components target WCAG 2.2 AA: keyboard support, focus-visible states, ARIA wiring, reduced motion, and RTL-safe layout.'],
        ['question' => 'What about responsive design?', 'answer' => 'Every block ships a centered container with responsive grids and type scales, so layouts adapt cleanly from mobile to wide desktop.'],
        ['question' => 'Is right-to-left supported?', 'answer' => 'Layouts use logical properties throughout, so they mirror correctly under dir="rtl" without any extra work on your side.'],
    ];
@endphp

<x-ui.section space="xl" {{ $attributes }}>
    <div class="mx-auto max-w-5xl px-4">
        <div class="mx-auto max-w-2xl text-center">
            @if ($eyebrow)
                <x-ui.badge variant="secondary" class="mb-4">{{ __($eyebrow) }}</x-ui.badge>
            @endif

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

            @if ($subheading)
                <p class="mt-4 text-pretty text-lg text-muted-foreground">{{ __($subheading) }}</p>
            @endif
        </div>

        <x-ui.separator class="mx-auto mt-10 max-w-2xl" />

        <dl class="mt-12 grid grid-cols-1 gap-x-12 gap-y-10 sm:grid-cols-2">
            @foreach ($items as $item)
                <div>
                    <dt class="text-base font-semibold leading-7 text-foreground">
                        {{ __($item['question']) }}
                    </dt>
                    <dd class="mt-2 text-pretty text-base leading-7 text-muted-foreground">
                        {{ __($item['answer']) }}
                    </dd>
                </div>
            @endforeach
        </dl>
    </div>
</x-ui.section>

Installation

terminal
php artisan ui:add blocks/faq-grid

Installs these dependencies automatically:

Registry contract

Install confidence

php artisan ui:add blocks/faq-grid 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.3
License
open
Stability
stable
Contract
v1
Foundation
≥ 1.0.0
Type Generated target
blade resources/views/blocks/faq-grid.blade.php

Registry dependencies

badge section separator

Package dependencies

composer: jml/brok:^0.2

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-grid.md
# Brok UI block: FAQ Grid (`faq-grid`)

A static two-column FAQ grid with a centered eyebrow badge, heading, and a separator above bold question / muted answer pairs.

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-grid
```

## Render it

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

## Props

- `eyebrow` (string, default `FAQ`)
- `heading` (string, default `Frequently asked questions`)
- `subheading` (string, default `Can’t find the answer you’re looking for? Reach out to our team and we’ll get back to you.`)
- `items` (mixed|null, default `null`)

## Use when

- Presenting questions and answers as a static two-column grid rather than an expand/collapse accordion.
- Fitting a short FAQ where every answer should be visible at once, with no interaction required.

## Avoid when

- Use faq-accordion for an accordion-based FAQ where answers are hidden until expanded.

## Rules

- Render the installed block with `<x-blocks.faq-grid />` 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-grid
- Registry JSON (files, props, contract): https://brokui.dev/r/open/blocks/faq-grid.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 questions and answers as a static two-column grid rather than an expand/collapse accordion.
  • Fitting a short FAQ where every answer should be visible at once, with no interaction required.

Avoid when

  • Use faq-accordion for an accordion-based FAQ where answers are hidden until expanded.

Anti-patterns

  • Do not replace semantic props with conflicting utility classes.
  • Do not remove labels, focus styles, or state attributes.

Usage

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

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

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-grid.blade.php Blade
@props([
    'eyebrow' => 'FAQ',
    'heading' => 'Frequently asked questions',
    'subheading' => 'Can’t find the answer you’re looking for? Reach out to our team and we’ll get back to you.',
    'items' => null,
])

@php
    $items ??= [
        ['question' => 'Do I own the installed code?', 'answer' => 'Yes. Components and blocks are copied into your project as plain Blade. There is no runtime lock-in — edit anything you like.'],
        ['question' => 'How do updates work?', 'answer' => 'Run the update command to pull upstream changes. Unedited files update automatically; edited files are never overwritten and produce a reviewable diff.'],
        ['question' => 'Can I theme it?', 'answer' => 'The entire system is driven by CSS design tokens. Re-theme light, dark, and per-surface variants by editing variables only.'],
        ['question' => 'Is it accessible?', 'answer' => 'Components target WCAG 2.2 AA: keyboard support, focus-visible states, ARIA wiring, reduced motion, and RTL-safe layout.'],
        ['question' => 'What about responsive design?', 'answer' => 'Every block ships a centered container with responsive grids and type scales, so layouts adapt cleanly from mobile to wide desktop.'],
        ['question' => 'Is right-to-left supported?', 'answer' => 'Layouts use logical properties throughout, so they mirror correctly under dir="rtl" without any extra work on your side.'],
    ];
@endphp

<x-ui.section space="xl" {{ $attributes }}>
    <div class="mx-auto max-w-5xl px-4">
        <div class="mx-auto max-w-2xl text-center">
            @if ($eyebrow)
                <x-ui.badge variant="secondary" class="mb-4">{{ __($eyebrow) }}</x-ui.badge>
            @endif

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

            @if ($subheading)
                <p class="mt-4 text-pretty text-lg text-muted-foreground">{{ __($subheading) }}</p>
            @endif
        </div>

        <x-ui.separator class="mx-auto mt-10 max-w-2xl" />

        <dl class="mt-12 grid grid-cols-1 gap-x-12 gap-y-10 sm:grid-cols-2">
            @foreach ($items as $item)
                <div>
                    <dt class="text-base font-semibold leading-7 text-foreground">
                        {{ __($item['question']) }}
                    </dt>
                    <dd class="mt-2 text-pretty text-base leading-7 text-muted-foreground">
                        {{ __($item['answer']) }}
                    </dd>
                </div>
            @endforeach
        </dl>
    </div>
</x-ui.section>

Ownership & lifecycle

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