Reference

ScrollArea

A box that scrolls within height:, with a thin scrollbar, its edges fading where there is more, and a Tab stop so a keyboard can scroll it.

ScrollArea(height: String, label: String, horizontal: Bool) { … }

Since 6.2.0

height

label

[1] compiled src/pages/Page1.wf

[2] compiled src/pages/Page2.wf

[3] compiled src/pages/Page3.wf

[4] compiled src/pages/Page4.wf

[5] compiled src/pages/Page5.wf

[6] compiled src/pages/Page6.wf

[7] compiled src/pages/Page7.wf

[8] compiled src/pages/Page8.wf

[9] compiled src/pages/Page9.wf

[10] compiled src/pages/Page10.wf

[11] compiled src/pages/Page11.wf

[12] compiled src/pages/Page12.wf

[13] compiled src/pages/Page13.wf

[14] compiled src/pages/Page14.wf

[15] compiled src/pages/Page15.wf

[16] compiled src/pages/Page16.wf

[17] compiled src/pages/Page17.wf

[18] compiled src/pages/Page18.wf

[19] compiled src/pages/Page19.wf

[20] compiled src/pages/Page20.wf

[21] compiled src/pages/Page21.wf

[22] compiled src/pages/Page22.wf

[23] compiled src/pages/Page23.wf

[24] compiled src/pages/Page24.wf

[25] compiled src/pages/Page25.wf

[26] compiled src/pages/Page26.wf

[27] compiled src/pages/Page27.wf

[28] compiled src/pages/Page28.wf

[29] compiled src/pages/Page29.wf

[30] compiled src/pages/Page30.wf

[31] compiled src/pages/Page31.wf

[32] compiled src/pages/Page32.wf

[33] compiled src/pages/Page33.wf

[34] compiled src/pages/Page34.wf

[35] compiled src/pages/Page35.wf

[36] compiled src/pages/Page36.wf

[37] compiled src/pages/Page37.wf

[38] compiled src/pages/Page38.wf

[39] compiled src/pages/Page39.wf

[40] compiled src/pages/Page40.wf

Example

wf

ScrollArea(height: "200px", label: "Build log") { style { border: 1px solid $color-border; border-radius: $radius-md; padding: 0.5rem 0.75rem } for line in (1..=40).map(i => "[{i}] compiled src/pages/Page{i}.wf") by line { Text(line).sm } }

Sideways

wf

ScrollArea(label: "Tags").horizontal { Row(gap: .sm) { style { width: max-content } for tag in ["Layout", "Forms", "Routing", "Stores", "Styling", "Motion", "Tests", "PDF", "Slides", "i18n"] by tag { Badge(tag).pill } } }

Props

Props of ScrollArea
PropTypeUnsetMeaning

height:

String

none

A CSS length, 300px: its max-height, past which it scrolls. Unset, it grows with what is inside unless its parent holds it

label:

String (required)

—

The region's accessible name (aria-label); it is a Tab stop so a keyboard can scroll it

horizontal:

Bool

false

It scrolls across, not down (overflow-x: auto, overflow-y: hidden), its fades at the start and end. Written as a flag, .horizontal, or horizontal: true.

Attribute families: global, aria, data. Plus the 22 universal props every element takes: animate:, exit:, speed:, duration:, delay:, easing:, stagger:, on:, count:, shared:, class:, ref:, drag:, dragGroup:, dropValue:, dropAxis:, dropInside:, roving:, trapFocus:, mount:, update:, cleanup:.

Flags and cases

A flag is written after the parentheses with a dot: a Bool prop, or a case of one of the element's enum props. A case the enum lacks is an error with a hint.

.horizontal

Events

Every element also takes the props, the events and the attribute families listed on every element.

Slots

children

Renders with the class wf-scroll-area, stable across releases, so a stylesheet may target it.