Floodgauge#

Floodgauge is a progress-bar variant that ttkbootstrap ships (ttk.Floodgauge) — a filling bar with text drawn over it, useful for showing progress with an inline label or percentage. It supports the same determinate and indeterminate modes as a progress bar. This page is the complete lookup reference.

Each option can be passed to the constructor and changed later with configure().

Options#

Option

Type

Description

bootstyle

str

The color of the bar and text — one of primary, secondary, success, info, warning, danger, light, dark. Default "primary".

value

int | float

The current progress value. Default 0.

maximum

int | float

The value at which the bar is full. Default 100.

mode

str

"determinate" (the bar fills to value) or "indeterminate" (a block bounces back and forth). Default "determinate".

text

str

Static text drawn over the bar. Default "".

mask

str

A template that overrides text and shows the live value, e.g. "{}% Complete" — the {} is replaced with the current value.

font

str | tuple

The font of the overlaid text. Default ("Helvetica", 12).

orient

str

"horizontal" or "vertical". Default "horizontal".

length

int

The long dimension of the gauge in pixels. Default 200.

thickness

int

The short dimension of the gauge in pixels. Default 50.

Methods#

start(interval=None)

Begin the animation — a bouncing block in indeterminate mode, or an auto-increment in determinate mode.

Parameters:

interval – milliseconds between steps (defaults to 20 ms indeterminate, 50 ms determinate).

Returns:

None.

stop()

Stop the animation started by start().

Returns:

None.

step(amount=1)

Increment the value by amount, wrapping back to the minimum after passing maximum.

Parameters:

amount – the amount to add (default 1).

Returns:

None.

value

The current progress value (property; equivalent to cget("value")). Set it with configure(value=...).

Styling options#

This section is for changing how the floodgauge looks. Define a style with style.configure(...) (and style.map(...) for per-state colors), then apply it with Floodgauge(bootstyle=...) or a custom style.

Bootstyle mapping#

Any of the accent colors – primary, secondary, success, info, warning, danger, light, dark – substitutes for primary below. neutral does not apply to this family.

A vertical widget resolves to the Vertical. twin of each style name above.

bootstyle

ttk style name

primary

primary.Horizontal.TFloodgauge

Layout (elements)#

The widget is drawn from these nested parts. Each is an element you can target by name in a custom layout:

primary.Horizontal.Floodgauge.trough
  primary.Horizontal.Floodgauge.pbar
  Floodgauge.label

Configurable style options#

Options you can set with style.configure(...) / style.map(...):

anchor, arrowcolor, arrowsize, background, barsize, bordercolor, borderwidth, compound, darkcolor, embossed, font, foreground, gripcount, image, justify, lightcolor, orient, pbarrelief, sliderlength, space, stipple, text, thickness, troughcolor, underline, width, wraplength

Supported states#

This style declares no style.map(...) overrides; any state-dependent appearance is drawn from its image elements.

Hand-styling example#

import ttkbootstrap as ttk

app = ttk.App()
style = app.style

style.configure("my.Horizontal.TFloodgauge", background="#3498db", foreground="white")

# This style backs an internal/shipped widget rather than a
# directly-constructed ttk widget; configure the style class above.

Shared capabilities#

Floodgauge also has the methods every widget inherits — configuration, placement, event binding, lifecycle, focus, and introspection. These are documented under Capabilities.

See also#