Skip to content

Checkbox

Warning

While the usage of checkbox and toggle may seem familiar, they are not. Checkboxes are often used when the user can select one or more items from a list, whereas toggles are used to set the state of an item, like whether to mute audio or not for instance.

Checkbox is used to select one or multiple items from a list.

Usage

Checkbox can be created by calling Lydie.Components.Controls.Checkbox:

Lydie.Components.Controls.Checkbox {
    OnClick = function(state) -- (1)!
        state:set(not state:get())
        print("Checkbox Clicked", state:get())
    end,
},
  1. When passing an OnClick function to the toggle, it is important to know that the default behavior of the toggle will be overridden. The toggle state will not react to the user response automatically and requires manual intervention. See Checkbox.luau:58.

Properties

Name Description Required Default
ZIndex The Z index of the button, used to show hierarchy of the button. ❌ 1
Position The relative position of the button ❌ UDim2.fromOffset(0, 0)

Functions

Name Description Required
OnClick: (state: Fusion.Value<boolean>) -> () A function invoked when MouseButton1Up is fired, where a user clicks the button and releases ❌