Button
Properties
Property | Type | Description |
---|---|---|
text | string | Text displayed on the button |
type | primary, default, dashed, text, link | The type of button |
icon | string | The Icon of the button |
size | default, large, small | Size of the button |
disabled | boolean | Weather the button is disabled |
loading | boolean | Loading indicator for the button |
ghost | boolean | Makes the buttons background transparent |
block | boolean | Makes the buttons width fit its parents width |
danger | boolean | Makes the button "warning" red |
shape | default , circle , round | Shape of the button |
customButton | boolean | When true, will be a button without any styling |
[events] | function | Please read the events page |
List of Icons. | ||
You can see more properties here. |
Children
Not supported on button - use the text
property for setting the text of the button.
Example
local btn = myUi:createElement("Button", {
text = "Hello, World!",
icon = "CaretRightOutlined",
loading = true,
onClick = function(uiName, elementId, event)
print("Hello, World! Button was Clicked")
end
})
This is how the example looks in-game:

icon
property is overwritten because ghost
is active.
Type
There are primary
button, default
button, dashed
button, text
button and link
button in antd.

Icon
Buttons can contain an icon.

Size
Buttons can have different sizes. default
, large
or small
.

Disabled
Buttons can be disabled, so the user is unable to press the button.

Loading
A loading indicator can be added to a button. Also makes the user unable to press the button.

Ghost
Ghost property will make button's background transparent.

Blocks
Will make the button fit to its parent width.

Danger
Makes the button "warning" red.

customButton
When set to true
the button will be a default HTML button without any styling.