Fusuma

Components / Basics

scroll

A column that scrolls when its content is taller than it is (give it a height).

Try it

This is the List page of the gallery, running in your browser: scroll is on it, and it is the real widget. Press Run, then use it.

Live: List, where scroll is usedOpen full size

A column that scrolls when its content is taller than it is (give it a height).

Give it a height. It scrolls with a drag, the wheel and the focus (a focused widget out of sight is brought in). Its scrollbar shows while it moves and fades after. For a row that scrolls sideways see scroll_x; for a very long list see virtual_list.

Signature

pub const fn scroll<C, M>(children: C) -> Special<C, M>

Methods

  • .padding(px: u32) -> Self — Room around the children.
  • .gap(px: u32) -> Self — Room between the children.
  • .width(length: Length) -> Self — The width.
  • .height(length: Length) -> Self — The height.
  • .align(align: CrossAlign) -> Self — How the children line up across the axis.
  • .background(surface: fusuma_ui::Surface) -> Self — The surface it is painted on.
  • .round(round: fusuma_ui::Round) -> Self — How round its corners are.
  • .side(side: fusuma_ui::Side, align: fusuma_ui::Align) -> Self — Which side of its anchor a hover card sits on, and how it lines up with it.
  • .after_ms(ms: u16) -> Self — How long the pointer rests on the anchor before a hover card opens.
  • .on_dismiss(message: M) -> Self — Sends message when a dialog or menu is dismissed (a press outside, Escape).

Example

use fusuma::{Length, button, column, scroll};
let view = column((scroll((button("One"), button("Two"), button("Three"))).height(Length::Fixed(96)),));
let built = fusuma::doc::built::<(), _>(&view);
assert_eq!(built.texts(), ["One", "Two", "Three"]);

All components · Source