Skip to main content

horizontal_pager

Function horizontal_pager 

Source
pub fn horizontal_pager() -> HorizontalPagerBuilder
Expand description

§horizontal_pager

Renders a horizontally swipeable pager that snaps between full-width pages.

§Usage

Build onboarding flows, image carousels, or horizontally paged dashboards.

§Parameters

  • args — configures paging, spacing, and layout behavior through the component’s builder parameters.
  • page_content — closure that renders each page by index.

§Examples

use tessera_components::pager::horizontal_pager;
use tessera_components::text::text;
use tessera_ui::tessera;

#[tessera]
fn demo() {
    material_theme()
        .theme(|| MaterialTheme::default())
        .child(move || {
            horizontal_pager()
                .page_count(4)
                .initial_page(2)
                .page_content(|page| {
                    text(format!("Page {page}"));
                });
        });
}