Skip to main content

A collection of ttk themes inspired by Bootstrap

Project description

Izzy-Themes-TTK

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

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 really 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.1.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ttkbootstrap-0.0.1-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ttkbootstrap-0.0.1.tar.gz
  • Upload date:
  • Size: 12.2 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.1.tar.gz
Algorithm Hash digest
SHA256 51bbf3e201e9fc9655149c8824839f9031c8b0ababb5485a579c8b2e7c1e655a
MD5 1127f1d5319c410d18e8e495f8febe65
BLAKE2b-256 086677fe3c429462e1eef23f2dc0466925881ec134cbc7e1ff554c1abee52596

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ttkbootstrap-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 11.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2c8fe5934f584d8aa323a7e109e60078178afca01e55b50900f465b20f5d78d5
MD5 ed85fa5dc3998cde8c4b2679e5e342a5
BLAKE2b-256 d13ec7bc2b7f451e54f9c95568a5cc9d5e5efbbb27e1271c647cfdbd8f7e27ab

See more details on using hashes here.

Supported by

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