Skip to content
Brok UI

Loading…

No results

Features

Open source

Feature sections — icon grids, bordered cards, alternating media rows, bento layouts, a services variant and an industries grid.

Preview

13 of 23

resources/views/blocks/features-carousel.blade.php Blade
@props([
    'eyebrow' => 'Features',
    'heading' => 'Everything in one fluid workflow',
    'subheading' => 'Slide through the capabilities your team relies on — each one is built to keep work fast, clear, and safe.',
    'features' => null,
])

@php
    $features ??= [
        [
            'title' => 'Own the source',
            'body' => 'Components are copied into your project as plain Blade. No runtime lock-in — edit anything you like.',
            'badge' => 'Core',
        ],
        [
            'title' => 'Token-driven theming',
            'body' => 'Re-theme light, dark, and per-surface variants by editing CSS variables only — never the components.',
            'badge' => null,
        ],
        [
            'title' => 'Accessible by default',
            'body' => 'Every primitive targets WCAG 2.2 AA: keyboard support, focus-visible states, ARIA wiring, and RTL-safe layout.',
            'badge' => 'A11y',
        ],
        [
            'title' => 'Safe updates',
            'body' => 'Pull upstream changes with one command. Edited files are never overwritten and produce a reviewable diff.',
            'badge' => null,
        ],
        [
            'title' => 'Composable blocks',
            'body' => 'Higher-level blocks compose the same primitives, so your patterns stay consistent across every page.',
            'badge' => null,
        ],
        [
            'title' => 'Laravel-native',
            'body' => 'Built on Blade, Tailwind, and Alpine — it fits the tools you already use instead of fighting them.',
            'badge' => 'New',
        ],
    ];
@endphp

<x-ui.section
    data-slot="features-13"
    x-data="{ scrollByAmount(direction) { this.$refs.track.scrollBy({ left: direction * 320, behavior: 'smooth' }); } }"
    space="xl" {{ $attributes }}
>
    <x-ui.container gutter="sm">
        <div class="flex flex-col gap-6 sm:flex-row sm:items-end sm:justify-between">
            <div class="max-w-2xl">
                @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>

            <div class="flex shrink-0 items-center gap-2">
                <x-ui.button
                    variant="outline"
                    size="icon"
                    type="button"
                    x-on:click="scrollByAmount(-1)"
                    :aria-label="__('Previous features')"
                >
                    <svg class="size-4 rtl:-scale-x-100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
                        <path d="m15 18-6-6 6-6" />
                    </svg>
                </x-ui.button>

                <x-ui.button
                    variant="outline"
                    size="icon"
                    type="button"
                    x-on:click="scrollByAmount(1)"
                    :aria-label="__('Next features')"
                >
                    <svg class="size-4 rtl:-scale-x-100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
                        <path d="m9 18 6-6-6-6" />
                    </svg>
                </x-ui.button>
            </div>
        </div>

        <ul
            x-ref="track"
            aria-label="{{ __('Features carousel') }}"
            tabindex="0"
            class="mt-12 flex snap-x snap-mandatory gap-6 overflow-x-auto scroll-smooth pb-4 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
        >
            @foreach ($features as $feature)
                <li class="w-[80%] shrink-0 snap-start sm:w-[45%] lg:w-[31%]">
                    <x-ui.card class="h-full border-border">
                        <x-ui.card.header>
                            <div class="flex items-center justify-between gap-4">
                                <x-ui.icon.tile>
                                    <svg class="size-6" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <path d="m9 12 2 2 4-4" />
                                        <path d="M12 3a9 9 0 1 0 9 9 9 9 0 0 0-9-9Z" />
                                    </svg>
                                </x-ui.icon.tile>

                                @if (! empty($feature['badge']))
                                    <x-ui.badge variant="secondary">{{ __($feature['badge']) }}</x-ui.badge>
                                @endif
                            </div>

                            <x-ui.card.title class="mt-4">{{ __($feature['title']) }}</x-ui.card.title>
                            <x-ui.card.description>{{ __($feature['body']) }}</x-ui.card.description>
                        </x-ui.card.header>
                    </x-ui.card>
                </li>
            @endforeach
        </ul>
    </x-ui.container>
</x-ui.section>

Installation

terminal
php artisan ui:add blocks/features-carousel

Installs these dependencies automatically:

Registry contract

Install confidence

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

Registry dependencies

badge button card container icon section

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.

features-carousel.md
# Brok UI block: Features Carousel (`features-carousel`)

A heading and subheading beside prev/next controls, above a horizontally scrolling, scroll-snapping track of feature cards. Each card carries an icon tile, optional badge, title, and body. Native horizontal scroll keeps it usable without JS; inline Alpine wires the prev/next buttons to scroll the track, and chevrons flip under RTL.

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/features-carousel
```

## Render it

```blade
<x-blocks.features-carousel />
```

## Props

- `eyebrow` (string, default `Features`)
- `heading` (string, default `Everything in one fluid workflow`)
- `subheading` (string, default `Slide through the capabilities your team relies on — each one is built to keep work fast, clear, and safe.`)
- `features` (mixed|null, default `null`)

## Use when

- Scrolling feature cards horizontally with a scroll-snapping track and prev/next controls beside the heading.
- Keeping the track usable without JavaScript via native horizontal scroll, with Alpine only wiring the prev/next buttons.

## Avoid when

- Use features-grid or features-cards for a wrapping grid instead of a horizontally scrolling track.

## Rules

- Render the installed block with `<x-blocks.features-carousel />` 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/features-carousel
- Registry JSON (files, props, contract): https://brokui.dev/r/open/blocks/features-carousel.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

  • Scrolling feature cards horizontally with a scroll-snapping track and prev/next controls beside the heading.
  • Keeping the track usable without JavaScript via native horizontal scroll, with Alpine only wiring the prev/next buttons.

Avoid when

  • Use features-grid or features-cards for a wrapping grid instead of a horizontally scrolling track.

Anti-patterns

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

Usage

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

resources/views/welcome.blade.php Blade
<x-blocks.features-carousel />

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/features-carousel.blade.php Blade
@props([
    'eyebrow' => 'Features',
    'heading' => 'Everything in one fluid workflow',
    'subheading' => 'Slide through the capabilities your team relies on — each one is built to keep work fast, clear, and safe.',
    'features' => null,
])

@php
    $features ??= [
        [
            'title' => 'Own the source',
            'body' => 'Components are copied into your project as plain Blade. No runtime lock-in — edit anything you like.',
            'badge' => 'Core',
        ],
        [
            'title' => 'Token-driven theming',
            'body' => 'Re-theme light, dark, and per-surface variants by editing CSS variables only — never the components.',
            'badge' => null,
        ],
        [
            'title' => 'Accessible by default',
            'body' => 'Every primitive targets WCAG 2.2 AA: keyboard support, focus-visible states, ARIA wiring, and RTL-safe layout.',
            'badge' => 'A11y',
        ],
        [
            'title' => 'Safe updates',
            'body' => 'Pull upstream changes with one command. Edited files are never overwritten and produce a reviewable diff.',
            'badge' => null,
        ],
        [
            'title' => 'Composable blocks',
            'body' => 'Higher-level blocks compose the same primitives, so your patterns stay consistent across every page.',
            'badge' => null,
        ],
        [
            'title' => 'Laravel-native',
            'body' => 'Built on Blade, Tailwind, and Alpine — it fits the tools you already use instead of fighting them.',
            'badge' => 'New',
        ],
    ];
@endphp

<x-ui.section
    data-slot="features-13"
    x-data="{ scrollByAmount(direction) { this.$refs.track.scrollBy({ left: direction * 320, behavior: 'smooth' }); } }"
    space="xl" {{ $attributes }}
>
    <x-ui.container gutter="sm">
        <div class="flex flex-col gap-6 sm:flex-row sm:items-end sm:justify-between">
            <div class="max-w-2xl">
                @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>

            <div class="flex shrink-0 items-center gap-2">
                <x-ui.button
                    variant="outline"
                    size="icon"
                    type="button"
                    x-on:click="scrollByAmount(-1)"
                    :aria-label="__('Previous features')"
                >
                    <svg class="size-4 rtl:-scale-x-100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
                        <path d="m15 18-6-6 6-6" />
                    </svg>
                </x-ui.button>

                <x-ui.button
                    variant="outline"
                    size="icon"
                    type="button"
                    x-on:click="scrollByAmount(1)"
                    :aria-label="__('Next features')"
                >
                    <svg class="size-4 rtl:-scale-x-100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
                        <path d="m9 18 6-6-6-6" />
                    </svg>
                </x-ui.button>
            </div>
        </div>

        <ul
            x-ref="track"
            aria-label="{{ __('Features carousel') }}"
            tabindex="0"
            class="mt-12 flex snap-x snap-mandatory gap-6 overflow-x-auto scroll-smooth pb-4 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
        >
            @foreach ($features as $feature)
                <li class="w-[80%] shrink-0 snap-start sm:w-[45%] lg:w-[31%]">
                    <x-ui.card class="h-full border-border">
                        <x-ui.card.header>
                            <div class="flex items-center justify-between gap-4">
                                <x-ui.icon.tile>
                                    <svg class="size-6" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <path d="m9 12 2 2 4-4" />
                                        <path d="M12 3a9 9 0 1 0 9 9 9 9 0 0 0-9-9Z" />
                                    </svg>
                                </x-ui.icon.tile>

                                @if (! empty($feature['badge']))
                                    <x-ui.badge variant="secondary">{{ __($feature['badge']) }}</x-ui.badge>
                                @endif
                            </div>

                            <x-ui.card.title class="mt-4">{{ __($feature['title']) }}</x-ui.card.title>
                            <x-ui.card.description>{{ __($feature['body']) }}</x-ui.card.description>
                        </x-ui.card.header>
                    </x-ui.card>
                </li>
            @endforeach
        </ul>
    </x-ui.container>
</x-ui.section>

Ownership & lifecycle

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