Skip to main content
Ctrl+K
Building a whole app, not just theming one? Try bootstack →
ttkbootstrap ttkbootstrap
  • User Guide
  • Widgets
  • Reference
  • Themes
  • Release notes
  • About
  • GitHub
  • User Guide
  • Widgets
  • Reference
  • Themes
  • Release notes
  • About
  • GitHub
  • Widgets
    • Button
    • Menubutton
    • OptionMenu
    • Menu
    • Entry
    • Spinbox
    • Combobox
    • DateEntry
    • Text
    • Checkbutton
    • Radiobutton
    • Listbox
    • Scale
    • LabeledScale
    • Progressbar
    • Meter
    • Floodgauge
    • Treeview
    • Tableview
    • Frame
    • Labelframe
    • Notebook
    • Panedwindow
    • Scrollbar
    • Separator
    • Sizegrip
    • Tk
    • TkFrame
    • Label
    • TkLabel
    • Canvas
  • Windows
    • App
    • Toplevel
  • Dialogs & overlays
    • Messagebox
    • Querybox
    • Dialog classes
    • Pickers
    • ToastNotification
    • ToolTip
  • Styling
  • Theming
  • Imaging
  • Localization
  • Fonts
  • Validation
  • Variables
  • Geometry
    • Pack
    • Grid
    • Place
    • Stacking order
  • Utilities
  • Capabilities
    • Configuration
    • Bind
    • Focus
    • Grab
    • After
    • Lifecycle
    • Clipboard
    • Selection
    • Busy
    • Interpreter
    • Widget & screen info
  • Events
    • Event types
    • Modifiers & keys
    • The event object
    • event_generate options
    • Built-in virtual events
  • Cursors
  • Reference
  • Widgets
  • Menubutton

Menubutton#

Menubutton is the native ttk button that pops up an attached menu (ttk.Menubutton), 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.

icon

str

Constructor keyword. A Bootstrap Icons glyph name (e.g. "gear-fill") shown on the widget; theme-aware — it follows the foreground color and states. See the Icons guide.

icon_size

int

Constructor keyword. The glyph size in pixels (scaled for high-DPI).

icon_only

bool

Constructor keyword. Show only the glyph (hide the text) and pad the widget into a square. Default False.

text

str

The label shown on the button.

textvariable

Variable

A StringVar whose value is shown as the label and tracked live.

menu

Menu

The Menu widget shown when the button is pressed.

direction

str

Where the menu pops up relative to the button: "above", "below", "left", "right", or "flush".

image

PhotoImage

An image to display in place of, or beside, the text.

compound

str

How text and image are combined: "none", "left", "right", "top", "bottom", or "center".

underline

int

The character index to underline (for a keyboard mnemonic), or -1.

width

int

The requested width in characters (negative sets a minimum).

padding

int | tuple

Extra space around the label, in pixels (a single value, or per-side).

state

str

"normal" or "disabled". For finer control use the state method (see Capabilities).

cursor

str

The mouse cursor over the menubutton (see Cursors).

takefocus

bool

Whether the menubutton accepts keyboard focus during traversal.

Styling options#

This section is for changing how the menubutton looks. Define a style with style.configure(...) (and style.map(...) for per-state colors), then apply it with Menubutton(style=...).

Bootstyle mapping#

Any of the accent colors – primary, secondary, success, info, warning, danger, light, dark – substitutes for primary below. neutral also applies here.

bootstyle

ttk style name

primary

primary.TMenubutton

primary outline

primary.Outline.TMenubutton

Layout (elements)#

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

Menubutton.border
  Menubutton.focus
    Menubutton.padding
      primary.TMenubutton.indicator
      Menubutton.label

Configurable style options#

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

anchor, background, bordercolor, borderwidth, compound, darkcolor, embossed, focuscolor, focussolid, focusthickness, font, foreground, image, justify, lightcolor, padding, relief, shiftrelief, space, stipple, text, underline, width, wraplength

Supported states#

The states you can target with style.map(...) to vary appearance by interaction:

!disabled, disabled, hover, pressed

Hand-styling example#

import ttkbootstrap as ttk

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

style.configure("my.TMenubutton", background="#3498db", foreground="white")
ttk.Menubutton(app, text="Custom", style="my.TMenubutton").pack(padx=8, pady=8)

app.mainloop()

Shared capabilities#

Menubutton 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#

  • Menubutton catalog page — usage, screenshots, and examples.

  • Tk ttk::menubutton manual page — the canonical upstream reference (Tcl 8.6).

previous

Button

next

OptionMenu

On this page
  • Options
  • Styling options
    • Bootstyle mapping
    • Layout (elements)
    • Configurable style options
    • Supported states
    • Hand-styling example
  • Shared capabilities
  • See also

© Copyright 2026, Israel Dryer.

Created using Sphinx 9.1.0.

Built with the PyData Sphinx Theme 0.20.0.