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

pip install ttkbootstrap

Demonstration

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

>> from ttkbootstrap import Demo
>> Demo()

Or, create and run this python script

from ttkbootstrap import Demo
if __name__ == '__main__':
    Demo()

Basic Usage

from ttkbootstrap import BootStyle, ttk

style = BootStyle()
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.

Create New Themes

Creating a new theme is easy... simply add a theme record to the themes.json file with the appropriate fields

    {
      "name": "cosmo",
      "font": "Helvetica",
      "type": "light",
      "colors": {
        "primary": "#2780e3",
        "secondary": "#373a3c",
        "success": "#3fb618",
        "info": "#9954bb",
        "warning": "#ff7518",
        "danger": "#ff0039",
        "bg": "#ffffff",
        "fg": "#373a3c",
        "selectbg": "#373a3c",
        "selectfg": "#ffffff",
        "light": "#fdfdfe",
        "border": "#ced4da",
        "inputfg": "#49506a"
      }
    }

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.6.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

ttkbootstrap-0.0.6-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file ttkbootstrap-0.0.6.tar.gz.

File metadata

  • Download URL: ttkbootstrap-0.0.6.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for ttkbootstrap-0.0.6.tar.gz
Algorithm Hash digest
SHA256 dddac0e8cfd57afa3f2c7d809e84c37b1c80d516a8ea33c4592aa0632511421c
MD5 5921947cdc34c8e37c8b5109a9b95342
BLAKE2b-256 7e43e5d14466fc24a930d30e2cf07b13fc16a7498475b3e561ea0ffc43752625

See more details on using hashes here.

File details

Details for the file ttkbootstrap-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: ttkbootstrap-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for ttkbootstrap-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 3a8e4c1807491f5b147a8c9bd8a44e80a3428499b73bee228bad0c35c327a9c2
MD5 7f0b231f5fc6c82240a680afc3cd5b09
BLAKE2b-256 28f3814c92bfe3f34a143ac69e3994a06ad29fda2e056ca5104787d9f3cc3244

See more details on using hashes here.

Supported by

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