import{_ as s,c as i,o as a,a4 as t}from"./chunks/framework.nQaBHiNx.js";const u=JSON.parse('{"title":"Button","description":"","frontmatter":{},"headers":[],"relativePath":"references/button.md","filePath":"references/button.md","lastUpdated":null}'),e={name:"references/button.md"},n=t(`
Buttons are interactive elements in Basalt that users can click on to trigger actions or events. They are commonly used to initiate commands, submit forms, or navigate through interfaces.
Button inherit from VisualElement and BasicElement
| Property | Type | Description |
|---|---|---|
| text | string | The text displayed on the button. |
local main = basalt.getMainFrame()
local aButton = main:addButton():setText("Click")
aButton:onClick(function(self, event, button, x, y)
if event == "mouse_click" and button == 1 then
basalt.debug("Left mousebutton got clicked!")
end
end)