Skip to main content

↖️ qb-menu

I like buttons

Introduction

  • Dynamic menu creation
  • Support for icons and images
  • Menu sorting functionality
  • Client-server communication
  • Easy-to-use Lua and JavaScript interfaces
  • Exports and events for extensive integration

Functions

openMenu

Opens the menu with provided data

  • data: table
    • header: string (optional)
    • txt: string (optional)
    • icon: string (optional)
    • isMenuHeader: boolean (optional)
    • disabled: boolean (optional)
    • hidden: boolean (optional)
    • params: table (optional)
      • event: string
      • args: any (optional)
      • isServer: boolean (optional)
      • isCommand: boolean (optional)
      • isQBCommand: boolean (optional)
      • sort: boolean
      • skipFirst: boolean
Example
exports['qb-menu']:openMenu({
{
header = "First Item",
icon = "icon-name",
txt = "Description",
isMenuHeader = false,
disabled = false,
hidden = false,
params = {
event = "event:name",
args = { arg1 = "value1" },
isServer = false,
isCommand = false,
isQBCommand = false,
isAction = false
}
},
{
header = "Second Item",
txt = "Another description",
isMenuHeader = false,
disabled = true,
hidden = false
}

}, true, false)

closeMenu

Closes the menu

Example
exports['qb-menu']:closeMenu()

Events

Opening Menu

This event allows you to open the input menu

Example
local data = {
{
header = 'City Hall',
isMenuHeader = true
},
{
header = 'ID Card',
txt = 'Get your ID Card',
params = {
event = 'qb-cityhall:client:openIdentityMenu'
}
}
}

TriggerClientEvent(source, 'qb-menu:client:openMenu', data)

Closing Menu

This event allows you to close the input menu

Example
TriggerClientEvent(source, 'qb-menu:client:closeMenu')