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_dimf32How far the empty block track recedes toward the surface behind the bar (0.0 = full fill color, 1.0 = indistinguishable from the background)
styleStyleBase style
hover_styleStyleHover style (when draggable)
extend_hover_style / inherit_hover_styleStyle / ()Extend or inherit the hover theme role instead of replacing it
focus_styleStyleFocus style
extend_focus_style / inherit_focus_styleStyle / ()Extend or inherit the focus theme role instead of replacing it
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, Claude, OpenCode, ThreeDot, ThreeDotFade, SquareFade, Lightsaber.

Speeds: Slow, Normal (default), Fast, Custom { frame_ms }.

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 an empty center slot in the spacing model
loadingboolShow loading spinner
loading_labelStringLoading label text
loading_styleStyleLoading indicator style
loading_spinner_styleSpinnerStyleLoading spinner variant
loading_spinner_speedSpinnerSpeedLoading spinner speed

Layout behavior: StatusBar is a convenience widget with content-aware left/center/right slots. When center content exists, the center slot is pinned to the center; side slots are allocated from the actual center width, keep the configured gap around the center, and clip at that boundary. Without center content, the default remains left + spacer + right; in this default path, single-sided bars omit the empty side lane. Set reserve_center_space(true) to keep an empty center slot in the spacing model for compatibility; it does not imply equal-third lanes.

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
widthLengthInner badge-frame width; caps are composed outside it
heightLengthBadge height
capCapStyleSegment treatment (Padded, Half, Round, or Arrow)
cap_sidesCapSidesWhich segment ends receive caps (Both by default)
cap_behindColorBackground painted behind cap glyphs
cap_same_colorboolUse a contrasting thin left separator for equal-color neighbors
rust
Badge::new("New")
    .style(Style::new().fg(Color::White).bg(Color::Red))
    .cap(CapStyle::Round)
    .cap_behind(Color::DarkGray)
    .position(BadgePosition::TopEnd)
    .child(button_element)

Round and Arrow require a Powerline/Nerd Font. Call font_safe() to degrade either to undecorated Padded; an explicitly selected Half remains. Thread the previous segment background through cap_behind when composing a zero-gap chain. Set cap_same_color(true) on a later equal-colored segment to draw a thin seam in the left cap cell.

Cap width semantics

Each visible cap is one cell. With Length::Auto, a cap first replaces one cell of explicit padding on its side, or one leading/trailing ASCII space in the label. That keeps the automatically measured segment width unchanged. If no replaceable cell exists, the cap extends the measured segment by one cell.

With an explicit badge width, that width belongs to the inner Frame; caps are composed outside it and therefore add one cell per visible cap to the total segment. An outer fixed-width container may clip that overflow. Use Auto for compact chains, or account for cap cells explicitly when fixing the total width.

Padded normally draws no cap cells. When cap_same_color(true) and the left side is enabled, it draws one thin separator and follows the same width rules.

See examples/powerline_bar.rs for compact wrappers, all cap styles, equal-color seams, side selection, and Nerd Font fallback.

MPL-2.0