LogoObsidian

Button

Buttons are used to trigger actions.

Playground

Use the switch to enable the sub button and edit its label.

Usage

You can create a Button by calling the AddButton method on a Groupbox.

Choose between positional arguments for quick calls or a configuration table for more customization.

Positional Arguments

Groupbox:AddButton("This is a button", function()
    print("Button clicked!")
end)
Arg IdxArgument DescriptionTypeDefault
1Text of the buttonstringnil
2Callback functionfunctionnil

Configuration Table

Groupbox:AddButton({
    Text = "This is a button",
    Func = function()
        print("Button clicked!")
    end
})

Prop

Type

Sub Button

You can also add a sub button to a button.

local MainButton = Groupbox:AddButton({
    Text = "Button",
    Func = function()
        print("Button clicked!")
    end
})
 
MainButton:AddButton({
    Text = "Sub Button",
    Func = function()
        print("Sub button clicked!")
    end
})
``` 

On this page