Progressbar#

Progressbar is the native ttk horizontal or vertical bar that shows progress (ttk.Progressbar), themed by ttkbootstrap. This page is the complete reference for its options, methods, and styling.

Options#

Each option can be set in the constructor and changed later with configure().

Option

Type

Description

bootstyle

str

Constructor keyword. An accent color, optionally with a variant. See Styling options for the available styles.

orient

str

The layout direction: "horizontal" or "vertical".

length

int

The requested size along the long axis, in pixels.

mode

str

"determinate" (tracks value) or "indeterminate" (animates back and forth).

maximum

float

The value at which the bar is full.

value

float

The current progress amount.

variable

Variable

A DoubleVar/IntVar bound to value.

phase

int

Read-only animation phase, useful for driving custom indeterminate styles.

cursor

str

The mouse cursor over the progress bar (see Cursors).

takefocus

bool

Whether the progress bar accepts keyboard focus during traversal.

Methods#

start(interval=None)

Begin auto-advancing (indeterminate mode) or animating; interval is the number of milliseconds between steps.

Returns:

None.

step(amount=None)

Increase value by amount (default 1.0), wrapping at maximum.

Returns:

None.

stop()

Stop the animation started by start.

Returns:

None.

Styling options#

This section is for changing how the progress bar looks. Define a style with style.configure(...) (and style.map(...) for per-state colors), then apply it with Progressbar(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.TProgressbar

primary striped

primary.Striped.Horizontal.TProgressbar

primary thin

primary.Thin.Horizontal.TProgressbar

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.Progressbar.trough
  primary.Horizontal.Progressbar.pbar

Configurable style options#

Note

The bar is drawn from a pre-rendered image keyed to the bootstyle color; style.configure(...) does not reach it. The options listed here style only the widget’s non-image parts (such as the focus ring). To recolor the bar, choose a bootstyle color; to change its shape or artwork, build a custom image-based layout – see Custom styles.

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

(none)

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.TProgressbar", background="#3498db", foreground="white")
ttk.Progressbar(app, style="my.Horizontal.TProgressbar").pack(padx=8, pady=8)

app.mainloop()

Shared capabilities#

Progressbar also has the methods every widget inherits — configuration, placement, event binding, lifecycle, focus, and introspection — plus the ttk state methods state / instate / identify. These are documented under Capabilities.

See also#