Scroller
A clipped list with edge fades. Optional buttons jump to the next direct child.
Vertical
overflow='y' is the default. Pass height as a number (px) or a CSS string.
Horizontal
Set overflow='x' and keep the rail wider than the viewport.
Both
overflow='both' when the canvas really moves on two axes — long log lines, maps of tiles.
Vertical with buttons
with-buttons scrolls the next or previous direct child into view. Do not wrap items in an extra layout node.
Horizontal with buttons
Best practices
- Use Scroller for a peer list that overflows one axis: chip rails, log streams, snippet stacks.
yfor feeds,xfor tiles.bothonly when content truly scrolls in two directions.- Button targets are direct children of the slot. An extra wrapper makes the arrows jump the whole block.
- Keep horizontal item widths and gaps even so the rail does not feel ragged.
- Fades appear on the clipped edges automatically. Do not add a second shadow on top.
- Huge lists belong in a virtualizer inside the scroller, not as hundreds of raw nodes.