Documentation Index
Fetch the complete documentation index at: https://mintlify.com/devhammed/react-gtk/llms.txt
Use this file to discover all available pages before exploring further.
GtkButton is a clickable widget that can contain text, icons, or custom child widgets. It’s one of the most commonly used interactive widgets in GTK applications.
Props
Text to display inside the button. Creates a label widget automatically.
The name of an icon to display in the button. Uses the system icon theme.
Whether the button has a visible frame/border.Default:
trueIf
true, an underscore in the label text indicates the next character should be used as the mnemonic accelerator key.Default: falseThe name of the action to trigger when clicked. Used with GTK actions.
The target value for the associated action.
Custom child widget or text to display inside the button. Overrides the
label prop.Events
Emitted when the button is clicked (pressed and released).
Emitted to animate press then release. Used for keyboard activation.
Inherited Props
GtkButton extends GtkWidget and inherits all its props including layout, styling, and event handling properties.
Usage
Basic Button
Button with State
Button with Custom Child
Use thechildren prop for custom content:
Flat Button (No Frame)
Create a flat button without a border:Button with Icon
Conditional Content
Change button content dynamically:Using Refs
Access the button instance with a ref:Common Patterns
Action Buttons
Create action button groups:Conditional Actions
Execute different actions based on state:Notes
Buttons can only have a single child. Use
GtkBox if you need multiple widgets inside a button.The
children prop takes precedence over the label prop. Use one or the other, not both.