> For the complete documentation index, see [llms.txt](https://docs.lynxmods.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lynxmods.com/developers/writing-lua-scripts/examples/basic-ui-examples.md).

# Basic UI Examples

This is a simple lua that adds elements to the Lynx Menu

![](https://3573802680-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAsCYNiiz9MUqkNOoPo%2F-MBe3f2c8Q91dV-oHLrm%2F-MBe6NNv39QVHNov1Uyj%2FLcKnJbHd.png?alt=media\&token=9e6eba82-4694-4682-8ef7-edc7987205ca)

Lua Script:

{% tabs %}
{% tab title="ui example.lua" %}

```lua
ui.Modal("Hello World!", "This modal will display a toast upon click", function()
    client.showToast("Hello World!")
end)

local checkbox = ui.Checkbox("Auto Meme", "Repeats what the users says", "auto_meme", false);

--[[ 
You can call checkbox.setValue(true); or 
checkbox.setValue(false) to force change the value of the checkbox
]]

events.addCallback("incoming_message", function(message)
    if (not checkbox.getValue()) then
        return
    end

    client.sendMessage(message.text, message.chat_jid);
end)
```

{% endtab %}
{% endtabs %}
