Fusuma

Components / Layout

styled

view with style on its node: a size, a margin or a place in a grid for a widget that has no setters of its own (a button as wide as its row, a spring of a fixed size, a row of a list that fills).

How it looks

Drawn by the toolkit from the example below. No page of the gallery uses styled yet, so there is nothing to run.

styled drawn by Fusuma

view with style on its node: a size, a margin or a place in a grid for a widget that has no setters of its own (a button as wide as its row, a spring of a fixed size, a row of a list that fills). Not for a container, a scrolling view, a dialog or a menu: those set their own style on every pass, and the two would undo each other.

The layout style of the node, in one value, for what the container's own words do not cover.

Signature

pub const fn styled<V>(style: Style, view: V) -> Styled<V>

Example

use fusuma::{Length, Style, styled, text};
let view = styled(Style::new().width(Length::Fixed(100)), text("Narrow"));
let built = fusuma::doc::built::<(), _>(&view);
assert_eq!(built.texts(), ["Narrow"]);

All components · Source