# Usage

<details>

<summary>TASK UI</summary>

* If you want to use the task ui to hide after <mark style="color:green;">3 seconds</mark> for example :

```lua
    local Data = {
        title = 'TITLE HERE', 
        txt = 'MESSAGE HERE\nANOTHER MESSAGE HERE'
    }
    exports['zat-ui']:ShowTBUi(Data, 3000)
```

* If you want to use the task ui and hide it later:&#x20;

```lua
    local Data = {
        title = 'TITLE HERE', 
        txt = 'MESSAGE HERE\nANOTHER MESSAGE HERE'
    }
    exports['zat-ui']:ShowTBUi(Data)
```

```lua
    exports['zat-ui']:hideUI()
```

</details>

<details>

<summary>MENU</summary>

```lua
RegisterCommand('menutest', function()
    exports['zat-ui']:openMenu({
        {
            header = 'Test Menu',
            txt = 'Test Menu Header',
            icon = 'fas fa-download',
            isMenuHeader = true, -- Set to true to make a nonclickable title
        },
        {
            header = 'First Button',
            txt = 'Print a message!',
            icon = 'fas fa-user',
            params = {
                event = 'zat-menu:client:testButton',
                args = {
		    message = 'This was called by clicking a button'
                }
            }
        },  
        {
            header = 'Second Button',
            txt = 'Open a secondary menu!',
            icon = 'fas fa-code-pull-request',
            -- disabled = false, -- optional, non-clickable and grey scale
            -- hidden = true, -- optional, hides the button completely
            params = {
                -- isServer = false, -- optional, specify event type
                event = 'zat-menu:client:subMenu',
                args = {
                    number = 2,
                }
            }
        },
    })
end)


RegisterNetEvent('zat-menu:client:subMenu', function(data)
    local number = data.number
    exports['zat-ui']:openMenu({
        {
            header = 'Return to main menu',
            txt = 'Return to main menu',
            icon = 'fa-solid fa-backward',
            params = {
                event = 'zat-menu:client:mainMenu',
                args = {}
            }
        },
        {
            header = 'Sub-menu button',
            txt = 'Print a message!',
            icon = 'fas fa-code-merge',
            params = {
                event = 'zat-menu:client:testButton',
                args = {
		    message = 'This was called by clicking a button'
                }
            }
        }
    })
end)

RegisterNetEvent('zat-menu:client:mainMenu', function()
    ExecuteCommand('menutest')
end)

RegisterNetEvent('zat-menu:client:testButton', function(data)
    print(data.message)
end)

```

</details>
