Skip to main content

A collection of modern ttk themes inspired by Bootstrap

Reason this release was yanked:

development version

Project description

ttkbootstrap

A collection of modern themes for Tkinter TTK built using standard, cross-platform themes ('clam', 'alt', 'classic', 'default'). Most of these themes are adapted and or/inspired from the open source bootstrap themes published on https://bootswatch.com/

Installation

https://pypi.org/project/ttkbootstrap/

pip install ttkbootstrap

Demonstration

You check out the examples below in a live demonstration by executing the following code in the python interpreter

>> python -m ttkbootstrap

Basic Usage

from ttkbootstrap import Style, ttk

style = Style()
style.theme_use('flatly')
root = style.master

# create widget with primary colors
ttk.Label(root, text='Hello world').pack()

# create widget with other colors
ttk.Label(root, text='Hello world', style='danger.TLabel').pack()

# run the window
root.mainloop()

Applying Styles

By default, the primary color for the theme will be used on widgets (See images below for examples of theme color options). All other themed colors can be used by applying the color prefix to the ttk widget class.

ttk.Label(root, text='Hello World', style='info.TLabel')
ttk.Button(root, text='Hello World', style='info.TButton')
ttk.Button(root, text='Hello World', style='warning.Outline.TButton')
ttk.Radiobutton(root, text='Hello World', style='danger.TRadiobutton')

Color prefixes

  • primary (default)
  • secondary
  • success
  • info
  • warning
  • danger

Defined ttk widget classes

  • TButton
  • Outline.TButton
  • TSpinbox
  • Horizontal.TScale
  • Vertical.TScale
  • Horizontal.TScrollbar
  • Vertical.TScrollbar
  • TCombobox
  • TFrame
  • TCheckbutton
  • TEntry
  • TLabel
  • TLabelframe
  • TNotebook
  • TMenubutton
  • Outline.TMenubutton
  • Horizontal.TProgressbar
  • Vertical.TProgressbar
  • TRadiobutton
  • Treeview

Exceptions

  • The Scale widget is built with an image set in the primary theme color; this cannot be changed via styles.
  • The Checkbutton and Radiobutton colors are only changeable on Linux and MacOS. Windows uses the built-in "xpnative" themed elements to build the widgets.

Light Themes





Dark Themes

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ttkbootstrap-0.0.15.tar.gz (19.2 kB view hashes)

Uploaded Source

Built Distribution

ttkbootstrap-0.0.15-py3-none-any.whl (25.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page