Skip to content

CTk Label

Lasha Kandelaki edited this page May 7, 2026 · 2 revisions

CTkLabel

Non-interactive text label with formatting and optional icon.

Wraps customtkinter.CTkLabel.

Properties

Groups appear in the panel in Content → Layout → Visual → Behavior order.

Group Properties
Text text, font_family, font_size, font_autofit (Auto Fit), Style (bold / italic / underline / strike), justify, Wrap (enabled / wraplength), text_color, text_color_disabled
Icon image, image_color, image_color_disabled, image_width / image_height, compound, preserve_aspect
Geometry x, y, width, height
Alignment anchor, padx, pady
Rectangle corner_radius
Main Colors fg_color, bg_color
Interaction label_enabled, cursor, takefocus

Notable behaviour:

  • Auto Fit derives font_size from the widget box + text. Toggling off restores the pre-autofit size.
  • Wrap falls back to widget width when wraplength is 0.
  • Preserve Aspect locks image_height to the icon's native ratio.
  • Disabled visuals are manual — label_enabled=False swaps text_color to text_color_disabled and uses image_color_disabled if set, instead of Tk's native white-wash.

Full schema lives in app/widgets/ctk_label.py.

Events

CTkLabel routes every binding through both the inner canvas and the Tk Label, so events fire on the rounded corners too.

Default — Click, Double click, Mouse enter, Mouse leave, Mouse wheel.

Advanced (collapsed by default in the Properties panel Events group) — Middle click, Right click, Mouse release, Mouse move, Resize, Shown, Hidden, Focus in, Focus out, Key press, Key release.

Hovering an event row in the Properties panel shows a tooltip describing when it fires and any caveat (<Motion> and <Configure> warn that they fire at 60+ Hz; <FocusIn> / <FocusOut> / <KeyPress> / <KeyRelease> warn that they need takefocus=True).

See Event Handlers for the binding workflow.


See alsoWidgets · Image · CustomTkinter docs

Clone this wiki locally