Scroll area

Usage

Add .scroll-area to a box with a set height or max-height. Overflowing content scrolls inside the box, and the scroll does not spread to the page. Add tabindex="0" for keyboard scrolling and an aria-label for a name. For a frame, put it in a .card.

  1. Stock sync #10
  2. Stock sync #9
  3. Stock sync #8
  4. Stock sync #7
  5. Stock sync #6
  6. Stock sync #5
  7. Stock sync #4
  8. Stock sync #3
  9. Stock sync #2
  10. Stock sync #1

Horizontal scrolling

Content wider than the box, like a table with many columns, scrolls sideways inside the box without overflowing the page.

Product SKU Stock Price Sold
T-shirt TS-001 120 $24.00 842
Tote bag TB-014 36 $36.00 215
Cap CP-007 0 $18.00 530

Attributes

Attribute / element Values Description
.scroll-area Scrolls both ways with a thin, border-coloured scrollbar. The scroll does not spread to the page (overscroll-behavior: contain)
height, max-height CSS length Required. Set it in page CSS or style. No default.
tabindex 0 Makes it focusable and scrollable with arrows, Page Up and Page Down
aria-label Text Name of the region for screen readers when it is focusable