Skip to content
Brok UI

Loading…

No results

Product Listing

Open source

Shop grids — a sort/results toolbar above a responsive grid of product cards with sale badge, rating and add-to-cart.

Preview

resources/views/blocks/product-listing-list.blade.php Blade
@props([
    'heading'      => 'New arrivals',
    'subheading'   => 'Discover our latest collection, crafted for everyday wear. Free shipping on orders over $75.',
    'resultsCount' => 5,
    'sortLabel'    => 'Featured',
    'products'     => null,
    'currency'     => 'USD',
])

@php
    $products ??= [
        ['name' => 'Aero Knit Runner', 'description' => 'Lightweight mesh upper with responsive cushioning for all-day comfort.', 'category' => 'Footwear', 'price' => '118', 'compareAt' => '148', 'rating' => 5, 'reviews' => 214, 'sale' => 'Save 20%', 'gradient' => 'from-primary/20 to-muted'],
        ['name' => 'Merino Travel Crew', 'description' => 'Fine-gauge merino wool that regulates temperature across climates.', 'category' => 'Knitwear', 'price' => '96', 'compareAt' => null, 'rating' => 5, 'reviews' => 88, 'sale' => null, 'gradient' => 'from-secondary/30 to-muted'],
        ['name' => 'Cascade Weatherproof Shell', 'description' => 'Three-layer laminate construction with fully taped seams.', 'category' => 'Outerwear', 'price' => '214', 'compareAt' => '260', 'rating' => 4, 'reviews' => 132, 'sale' => 'Save $46', 'gradient' => 'from-accent/40 to-muted'],
        ['name' => 'Field Canvas Tote', 'description' => 'Waxed organic cotton with reinforced base panel and interior pockets.', 'category' => 'Accessories', 'price' => '72', 'compareAt' => null, 'rating' => 4, 'reviews' => 47, 'sale' => 'New', 'gradient' => 'from-muted to-secondary/20'],
        ['name' => 'Studio Linen Shirt', 'description' => 'Relaxed European linen with mother-of-pearl buttons and a curved hem.', 'category' => 'Shirts', 'price' => '84', 'compareAt' => '110', 'rating' => 4, 'reviews' => 309, 'sale' => 'Sale', 'gradient' => 'from-primary/10 to-accent/20'],
    ];
@endphp

<x-ui.section space="md" {{ $attributes }}>
    <div class="mx-auto max-w-5xl px-4">
        <header class="mb-8">
            <h2 class="text-balance text-2xl font-bold tracking-tight sm:text-3xl">{{ __($heading) }}</h2>
            @if ($subheading)
                <p class="mt-2 text-pretty text-sm text-muted-foreground sm:text-base">{{ __($subheading) }}</p>
            @endif
        </header>

        <div class="mb-6 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
            <p class="text-sm text-muted-foreground">{{ __(':count results', ['count' => $resultsCount]) }}</p>
            <x-ui.button variant="outline" size="sm" type="button" aria-label="{{ __('Sort products') }}">
                <span class="text-muted-foreground">{{ __('Sort by') }}:&nbsp;</span>
                <span class="font-medium text-foreground">{{ __($sortLabel) }}</span>
                <x-slot:iconTrailing>
                    <svg class="size-4 text-muted-foreground" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 9 6 6 6-6" /></svg>
                </x-slot:iconTrailing>
            </x-ui.button>
        </div>

        <ul role="list" class="flex flex-col gap-4">
            @foreach ($products as $product)
                <li>
                    <x-ui.product-card :product="$product" layout="row" :currency="$currency" />
                </li>
            @endforeach
        </ul>
    </div>
</x-ui.section>

Installation

terminal
php artisan ui:add blocks/product-listing-list

Installs these dependencies automatically:

Registry contract

Install confidence

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

Registry dependencies

button product-card 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.

product-listing-list.md
# Brok UI block: Product Listing List (`product-listing-list`)

An e-commerce product listing in a list/row layout — a sort toolbar above divided product rows with thumbnail, rating, price and add-to-cart.

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/product-listing-list
```

## Render it

```blade
<x-blocks.product-listing-list />
```

## Props

- `heading` (string, default `New arrivals`) — Section heading.
- `subheading` (string, default `Discover our latest collection, crafted for everyday wear. Free shipping on orders over $75.`) — Supporting copy under the heading.
- `results-count` (int, default `5`) — Number of matching products shown in the toolbar.
- `sort-label` (string, default `Featured`) — Label for the currently applied sort order.
- `products` (mixed|null, default `null`) — Array of product entries rendered as rows.
- `currency` (string, default `USD`) — ISO currency code used to format product prices.

## Use when

- Rendering an ecommerce product listing as divided rows rather than a card grid, each row showing a thumbnail, description, rating, price and add-to-cart button.
- Wanting a denser, description-forward layout suited to fewer, more detailed products above the fold.

## Avoid when

- Needing a multi-column card grid; use product-listing-grid, or a horizontal carousel; use product-listing-carousel.

## Rules

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

  • Rendering an ecommerce product listing as divided rows rather than a card grid, each row showing a thumbnail, description, rating, price and add-to-cart button.
  • Wanting a denser, description-forward layout suited to fewer, more detailed products above the fold.

Avoid when

  • Needing a multi-column card grid; use product-listing-grid, or a horizontal carousel; use product-listing-carousel.

Anti-patterns

  • Do not replace semantic props with conflicting utility classes.
  • Do not remove labels, focus styles, or state attributes.
Anatomy
header heading subheading toolbar result count sort button product row list product row

Usage

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

resources/views/welcome.blade.php Blade
<x-blocks.product-listing-list />

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/product-listing-list.blade.php Blade
@props([
    'heading'      => 'New arrivals',
    'subheading'   => 'Discover our latest collection, crafted for everyday wear. Free shipping on orders over $75.',
    'resultsCount' => 5,
    'sortLabel'    => 'Featured',
    'products'     => null,
    'currency'     => 'USD',
])

@php
    $products ??= [
        ['name' => 'Aero Knit Runner', 'description' => 'Lightweight mesh upper with responsive cushioning for all-day comfort.', 'category' => 'Footwear', 'price' => '118', 'compareAt' => '148', 'rating' => 5, 'reviews' => 214, 'sale' => 'Save 20%', 'gradient' => 'from-primary/20 to-muted'],
        ['name' => 'Merino Travel Crew', 'description' => 'Fine-gauge merino wool that regulates temperature across climates.', 'category' => 'Knitwear', 'price' => '96', 'compareAt' => null, 'rating' => 5, 'reviews' => 88, 'sale' => null, 'gradient' => 'from-secondary/30 to-muted'],
        ['name' => 'Cascade Weatherproof Shell', 'description' => 'Three-layer laminate construction with fully taped seams.', 'category' => 'Outerwear', 'price' => '214', 'compareAt' => '260', 'rating' => 4, 'reviews' => 132, 'sale' => 'Save $46', 'gradient' => 'from-accent/40 to-muted'],
        ['name' => 'Field Canvas Tote', 'description' => 'Waxed organic cotton with reinforced base panel and interior pockets.', 'category' => 'Accessories', 'price' => '72', 'compareAt' => null, 'rating' => 4, 'reviews' => 47, 'sale' => 'New', 'gradient' => 'from-muted to-secondary/20'],
        ['name' => 'Studio Linen Shirt', 'description' => 'Relaxed European linen with mother-of-pearl buttons and a curved hem.', 'category' => 'Shirts', 'price' => '84', 'compareAt' => '110', 'rating' => 4, 'reviews' => 309, 'sale' => 'Sale', 'gradient' => 'from-primary/10 to-accent/20'],
    ];
@endphp

<x-ui.section space="md" {{ $attributes }}>
    <div class="mx-auto max-w-5xl px-4">
        <header class="mb-8">
            <h2 class="text-balance text-2xl font-bold tracking-tight sm:text-3xl">{{ __($heading) }}</h2>
            @if ($subheading)
                <p class="mt-2 text-pretty text-sm text-muted-foreground sm:text-base">{{ __($subheading) }}</p>
            @endif
        </header>

        <div class="mb-6 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
            <p class="text-sm text-muted-foreground">{{ __(':count results', ['count' => $resultsCount]) }}</p>
            <x-ui.button variant="outline" size="sm" type="button" aria-label="{{ __('Sort products') }}">
                <span class="text-muted-foreground">{{ __('Sort by') }}:&nbsp;</span>
                <span class="font-medium text-foreground">{{ __($sortLabel) }}</span>
                <x-slot:iconTrailing>
                    <svg class="size-4 text-muted-foreground" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 9 6 6 6-6" /></svg>
                </x-slot:iconTrailing>
            </x-ui.button>
        </div>

        <ul role="list" class="flex flex-col gap-4">
            @foreach ($products as $product)
                <li>
                    <x-ui.product-card :product="$product" layout="row" :currency="$currency" />
                </li>
            @endforeach
        </ul>
    </div>
</x-ui.section>

Ownership & lifecycle

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