GtkButton

A widget that emits a signal when clicked.

Preview

CSS Node Tree

button[.flat][.text-button][.image-button][.image-text-button]
  └── <child> (label, image, or custom content)

Props

Prop

Type

Style Classes

ClassEffect
.suggested-actionBlue accent background
.destructive-actionRed accent background
.flatNo background (same as hasFrame={false})
.pillFully rounded corners
.circularCircular shape
.osdOn-screen display style

Keyboard

  • Space / Enter — Activates the button: it shows .keyboard-activating until the key is released (250 ms at most), then is clicked
  • Alt + mnemonic — With useUnderline, _ marks the next character of the label ("_Save"). Holding Alt underlines it, and Alt with that key activates the button

GTK4 Documentation →

On this page