thaw/demo_markdown/docs/progress/mod.md
luoxiaozero 1e4832a6d0
refactor demo docs (#64)
* demo: refactor docs

* demo: refactor docs

* demo: refactor docs

* demo: refactor docs
2023-12-31 23:33:05 +08:00

1.5 KiB

Progress

let percentage = create_rw_signal(0.0f32);

view! {
    <Space vertical=true>
        <Progress percentage show_indicator=false/>
        <Progress percentage/>
        <Progress percentage indicator_placement=ProgressIndicatorPlacement::Inside/>
        <Progress percentage color=ProgressColor::Success/>
        <Progress percentage color=ProgressColor::Warning/>
        <Progress percentage color=ProgressColor::Error/>
        <Space>
            <Button on_click=move |_| percentage.update(|v| *v -= 10.0)>"-10%"</Button>
            <Button on_click=move |_| percentage.update(|v| *v += 10.0)>"+10%"</Button>
        </Space>
    </Space>
}

Progress Props

Name Type Default Description
percentage MaybeSignal<f32> Default::default() Percentage value.
color MaybeSignal<ProgressColor> ProgressColor::Primary Progress color.
show_indicator MaybeSignal<bool> true Whether to display indicators.
indicator_placement MaybeSignal<ProgressIndicatorPlacement> ProgressIndicatorPlacement::Outside Indicator placement.