Guides
Navigation
Feedback
Overlays
Layout
Data Display
Forms
.md

Layout

scroll-area

Scrollable region with a styled, themed scrollbar.

Releases

v0.1.0
v0.2.0
v0.3.0
v0.4.0
v0.5.0
v0.6.0
v0.7.0
v0.8.0
v0.9.0
v0.10.0
v0.11.0
v0.12.0
v0.13.0
v0.14.0
v0.15.0
v0.16.0
v0.17.0
v0.18.0
v0.19.0
v0.20.0

Installation

php artisan ui:add scroll-area

Usage

<x-ui.scroll-area class="h-48 w-full max-w-xs rounded-md border p-4">
    {{-- The height comes from `class`; without one there is nothing to scroll. --}}
    @foreach ($releases as $release)
        <div class="border-b py-2 text-sm last:border-b-0">{{ $release }}</div>
    @endforeach
</x-ui.scroll-area>

{{-- horizontal scrolls sideways instead; give it a width, not a height --}}
<x-ui.scroll-area orientation="horizontal" class="w-full max-w-xs rounded-md border p-4">
    <div class="flex gap-4">
        @foreach ($covers as $cover)
            <img src="{{ $cover }}" alt="" class="size-32 shrink-0 rounded-md" />
        @endforeach
    </div>
</x-ui.scroll-area>

Native overflow, no JavaScript and no synthetic scrollbar. Set a height or max-height via `class` or nothing scrolls. Orientations: vertical, horizontal, both.

Props

Every prop with its default. Pass any of them as attributes, using : to bind a PHP value.

@props([
    'orientation' => 'vertical',
])