Searching Puzzle Pieces

Type to search Puzzle Pieces.

Scroll Area

A wrapper that hides the native scrollbar and paints its own overlay one — a rounded, fading, draggable thumb. Content scrolls natively (wheel, trackpad, touch, and keyboard), so this is a purely cosmetic layer; set orientation to pick which axes get a thumb and maxHeight to cap the viewport.

  • Extra-virgin olive oil
  • Garlic, minced
  • Yellow onion
  • Roma tomatoes
  • Fresh basil
  • Sea salt
  • Cracked black pepper
  • Parmesan, grated
  • Dried oregano
  • Red pepper flakes
  • Balsamic vinegar
  • Pine nuts
  • Spaghetti
  • Baby spinach
  • Lemon zest
  • Unsalted butter

Installation

Copy the piece into your app — it compiles with your build and the code is yours:

puzzle add piece scroll-area

Requires the pieces.css tokens merged into your app styles (see Introduction).

Usage

import ScrollArea from '@/components/ui/ScrollArea.pzl';
<ScrollArea maxHeight={ 256 } label="Ingredients" class="w-72 rounded-lg border border-border bg-surface"></ScrollArea>

Horizontal

01
02
03
04
05
06
07
08

Both axes

12:04:01 GET /api/orders 200 14ms

12:04:02 GET /api/orders/1042 200 9ms

12:04:04 POST /api/orders 201 38ms

12:04:05 GET /api/inventory 200 22ms

12:04:07 PATCH /api/orders/1042 200 17ms

12:04:09 GET /api/customers?page=2 200 31ms

12:04:11 DELETE /api/carts/abandon 204 6ms

12:04:12 GET /api/reports/daily 500 altered upstream timeout

12:04:14 GET /api/orders 200 11ms

12:04:16 POST /api/webhooks/stripe 200 44ms

Accessibility

Scrolling stays native, so keyboard and screen-reader support come for free — the custom thumb is purely decorative on top:

  • Native scroll — wheel, trackpad, and touch are untouched; the thumb only mirrors the position
  • Keyboard — the viewport takes tabindex="0" only while it overflows, so arrow keys, Page Up / Page Down, Space, and Home / End scroll it once focused
  • Landmark — pass label and the viewport becomes a role="region" a screen-reader user can enter by name
  • Decorative thumb — the bar is aria-hidden; it is draggable with a pointer but never focusable
  • Reduced motion — the fade-in / fade-out honors prefers-reduced-motion