Skip to content

Feedback & Status Widgets

ProgressBar

Visual progress indicator with multiple styles and optional drag interaction.

PropTypeDescription
progressf64Constructor - progress 0.0–1.0
progress_styleProgressStyleVisual style variant
show_percentageboolShow percentage text
percentage_positionProgressTextPositionWhere to show percentage
labelStringCustom label text shown in addition to percentage
label_positionProgressTextPositionWhere to show label text
label_styleStyleLabel style
filled_styleStyleFilled portion style (default: green)
filled_gradientColorGradientFilled portion gradient
empty_styleStyleEmpty portion style (default: dark gray)
block_empty_bg_dimf32Dim intensity for block-track background
styleStyleBase style
hover_styleStyleHover style (when draggable)
focus_styleStyleFocus style
paddingimpl Into<Padding>Padding
widthLengthWidth
heightLengthHeight
draggableboolAllow drag to change value
stepf64Drag step increment
invertedboolFlip fill direction
focusableboolAccept focus
targetOption<f64>Optional marker position
target_styleStyleMarker style
target_symbolcharMarker character
zonesVec<ProgressZone>Threshold zones with custom styles
on_changeCallback<f64>Value changed (when draggable)
on_clickCallback<f64>Clicked position

Progress styles: Block (default), Line, LineDotted, Dots, Arrow, Rect, Braille, Custom { filled: char, empty: char }.

Text positions: Left, Right (default), Above, Below, Middle (Middle only works with ProgressStyle::Block). Percentage and label text share one line when both use the same Above, Below, or Middle position.

rust
ProgressBar::new(0.67)
    .progress_style(ProgressStyle::Block)
    .show_percentage(true)
    .filled_style(Style::new().fg(Color::Green))
    .target(0.8)
    .target_style(Style::new().fg(Color::Yellow))
    .zones(vec![
        ProgressZone::new(0.75).style(Style::new().fg(Color::Yellow)),
        ProgressZone::new(0.90).style(Style::new().fg(Color::Red)),
    ])

Spinner

Animated loading indicator.

PropTypeDescription
spinner_styleSpinnerStyleAnimation style variant
speedSpinnerSpeedAnimation speed
frameOption<usize>Manual frame index (controlled mode)
labelStringLabel text next to spinner
gapu16Space between spinner and label
styleStyleSpinner style
label_styleStyleLabel style
widthLengthWidth
heightLengthHeight

Animation styles: Dots (default), Line, Circle, Arc, Braille, Moon, Box, Bar, Arrow, Fade, Trail, Earth, OpenCode, ThreeDot, ThreeDotFade, SquareFade, Lightsaber.

Speeds: Slow, Normal (default), Fast.

rust
Spinner::new()
    .spinner_style(SpinnerStyle::Dots)
    .speed(SpinnerSpeed::Normal)
    .label("Loading...")
    .style(Style::new().fg(Color::Cyan))

// Controlled mode (advance manually via .tick())
Spinner::new().frame(Some(ctx.state.spinner_frame))

StatusBar

Application status line with left/center/right slots.

Prop / MethodTypeDescription
.left(Element)methodLeft slot content
.center(Element)methodCenter slot content
.right(Element)methodRight slot content
styleStyleBar container style (default for all slots)
left_styleStyleLeft slot style patch
center_styleStyleCenter slot style patch
right_styleStyleRight slot style patch
paddingimpl Into<Padding>Bar padding
gapu16Slot gap
widthLengthWidth
heightLengthHeight
reserve_center_spaceboolKeep 3-lane layout even when center is empty
loadingboolShow loading spinner
loading_labelStringLoading label text
loading_styleStyleLoading indicator style
loading_spinner_styleSpinnerStyleLoading spinner variant
loading_spinner_speedSpinnerSpeedLoading spinner speed

Layout behavior: Without center content, uses a 2-lane layout (left + spacer + right). Set reserve_center_space(true) to always use 3-lane. If only one side has content, the empty lane is omitted.

rust
StatusBar::new()
    .style(Style::new().bg(Color::DarkGray))
    .left_style(Style::new().fg(Color::Green))
    .left(Text::new("MODE: NORMAL").into())
    .right(Text::new("ln 42, col 8").into())

// RSX
rsx! {
    StatusBar {
        style: Style::new().bg(Color::DarkGray),
        left: Text { content: "Mode: Normal" }
        right: Badge { content: "v1.0" }
    }
}

PaginationBar

Composable pagination controls for PaginationState with button-style personalization.

Prop / MethodTypeDescription
PaginationBar::new(state)constructorControlled state source
labelsPaginationLabelsSet all nav labels (first/prev/next/last)
first_label / prev_label / next_label / last_labelStringOverride individual nav labels
show_first_lastboolShow/hide first/last buttons
show_range_infoboolShow/hide (rows x-y of total) in center label
gapu16Horizontal spacing between controls
button_variantButtonVariantShared variant for all nav buttons
button_border_styleBorderStyleOutlined button border style
button_styleStyleBase nav button style
button_hover_styleStyleHover nav button style
button_focus_styleStyleFocus nav button style
button_disabled_styleStyleDisabled nav button style
button_overrides_forPaginationAction + PaginationButtonOverridesPer-button style override
first_button_overrides / prev_button_overrides / next_button_overrides / last_button_overridesPaginationButtonOverridesPer-button style override helpers
info_styleStyleCenter text style
info_formatterFn(PaginationInfo) -> Arc<str>Custom center text formatter
on_actionCallback<PaginationAction>Emits First/Prev/Next/Last
rust
PaginationBar::new(self.pagination)
    .button_variant(ButtonVariant::Outlined)
    .button_border_style(BorderStyle::Rounded)
    .button_style(Style::new().fg(Color::Cyan))
    .next_button_overrides(
        PaginationButtonOverrides::new().style(Style::new().fg(Color::Green)),
    )
    .info_formatter(|info| {
        Arc::from(format!(
            "Pg {} / {}  ·  {}..{} / {}",
            info.page_number,
            info.total_pages,
            if info.total_items == 0 { 0 } else { info.start + 1 },
            info.end,
            info.total_items,
        ))
    })
    .button_hover_style(Style::new().fg(Color::White).bg(Color::Blue))
    .button_focus_style(Style::new().fg(Color::Black).bg(Color::Yellow).bold())
    .on_action(ctx.link().callback(Msg::Navigate))

Use PaginationState for data windowing (range(), next_page(), set_per_page(), etc.) and pair it with PaginationBar for UI controls.


Navigation trail.

PropTypeDescription
segmentsVec<Arc<str>>Path segments
separatorcharSeparator character (default: /)
gapu16Gap between segments
activeOption<usize>Currently active segment index
styleStyleBase style
active_styleStyleActive segment style
inactive_styleStyleInactive segment style
hover_styleStyleHover style
separator_styleStyleSeparator style
alignAlignAlignment
justifyJustifyJustification
paddingimpl Into<Padding>Padding
widthLengthWidth
heightLengthHeight
on_selectCallback<usize>Segment selected

Badge

Small status indicator overlaid on an element.

PropTypeDescription
contentimpl Into<String>Constructor - badge text
childElementElement to attach badge to
styleStyleBadge background/text style
text_styleStyleBadge text style
borderboolBadge border
border_styleBorderStyleBadge border style
paddingimpl Into<Padding>Badge padding
offset(i16, i16)Position offset from corner
positionBadgePositionCorner to attach to
widthLengthBadge width
heightLengthBadge height
rust
Badge::new("New")
    .style(Style::new().fg(Color::White).bg(Color::Red))
    .position(BadgePosition::TopRight)
    .child(button_element)

MIT OR Apache-2.0