ButtonProps

The Button component provides ability to add and manipulate native button widgets. It is based on NodeGui's QPushButton.

Example

import React from "react";
import { Renderer, Button, Window } from "@nodegui/react-nodegui";
const App = () => {
return (
<Window>
<Button style={buttonStyle} text={"Hello World"} />
</Window>
);
};
const buttonStyle = `
color: white;
`;
Renderer.render(<App />);

Hierarchy

ViewProps

ButtonProps

Index

Properties

Properties

Optional cursor

cursor? : CursorShape | QCursor

Inherited from ViewProps.cursor

Sets the window mouse cursor. QWidget: setCursor


Optional enabled

enabled? : undefined | false | true

Inherited from ViewProps.enabled

Sets the property that tells whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. QWidget: setEnabled


Optional flat

flat? : undefined | false | true

Sets whether the button border is raised. QPushButton: setFlat


Optional geometry

geometry? : Geometry

Inherited from ViewProps.geometry

Sets the screen position as well as size of the widget. QWidget: setGeometry


Optional icon

icon? : QIcon

Sets an icon in the button. QPushButton: setIcon


Optional id

id? : undefined | string

Inherited from ViewProps.id

Sets the object name (id) of the widget in Qt. Object name can be analogous to id of an element in the web world. Using the objectName of the widget one can reference it in the Qt's stylesheet much like what we do with id in the web world. QWidget: setObjectName


Optional maxSize

maxSize? : Size

Inherited from ViewProps.maxSize

Sets the maximum size of the widget. QWidget: setMaximumSize


Optional minSize

minSize? : Size

Inherited from ViewProps.minSize

Sets the minimum size of the widget. QWidget: setMinimumSize


Optional mouseTracking

mouseTracking? : undefined | false | true

Inherited from ViewProps.mouseTracking

Sets the property that tells whether mouseTracking is enabled for the widget. QWidget: setMouseTracking


Optional on

on? : ListenerMap

Inherited from ViewProps.on

Prop to set the event listener map. See Handlong Events


Optional pos

pos? : Position

Inherited from ViewProps.pos

Sets the screen position of the widget. QWidget: move


Optional ref

ref? : any

Inherited from ViewProps.ref

Prop to set the ref. The ref will return the underlying nodegui widget.


Optional size

size? : ViewSize

Inherited from ViewProps.size

Sets both the minimum and maximum sizes of the widget. QWidget: setFixedSize


Optional style

style? : undefined | string

Inherited from ViewProps.style

Sets the inline stylesheet property. QWidget: setInlineStyle


Optional styleSheet

styleSheet? : undefined | string

Inherited from ViewProps.styleSheet

Sets the property that holds the widget's style sheet. QWidget: setStyleSheet


Optional text

text? : undefined | string

Sets the given text to the button. QPushButton: setText


Optional visible

visible? : undefined | false | true

Inherited from ViewProps.visible

Shows or hides the widget and its children. QWidget: show


Optional windowIcon

windowIcon? : QIcon

Inherited from ViewProps.windowIcon

Sets the window icon. QWidget: setWindowIcon


Optional windowOpacity

windowOpacity? : Number

Inherited from ViewProps.windowOpacity

This property holds the level of opacity for the window. QWidget: setWindowOpacity


Optional windowState

windowState? : WindowState

Inherited from ViewProps.windowState

Sets the window state. QWidget: setWindowState


Optional windowTitle

windowTitle? : undefined | string

Inherited from ViewProps.windowTitle

Sets the window title property. QWidget: setWindowTitle