Fusuma

Components / Composite

top_bar

The bar across the top of a screen: a title on the left and, on the right, the actions (icon buttons, a menu).

Try it

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

Live: Bars, where top_bar is usedOpen full size

Also on this pagetoolbaricon_badgefabsearch_barmarksnavigation_bartoggle_groupchip_groupbutton_groupavatar_group

The bar across the top of a screen: a title on the left and, on the right, the actions (icon buttons, a menu).

Signature

pub fn top_bar<'a, M: Clone + 'a, C: Children<M> + 'a>( title: &'a str, actions: C, ) -> impl View<M> + 'a

Example

use fusuma::{Icon, button, top_bar};
let view = top_bar("Inbox", (button("Edit").icon(Icon::Settings),));
let built = fusuma::doc::built::<(), _>(&view);
assert_eq!(built.texts(), ["Inbox", "Edit"]);

All components · Source