logoWindUI Shiny

Sidebar Elements

APIs for creating controls in the left sidebar on the Window object.

These APIs create controls in the left sidebar on the Window object.

Label APIs

Window:SideBarLabel(config)
Aliases: Window.SidebarLabel, Window.Label

Config:

KeyTypeDefault
Title / Textstring"Label"
Iconstring?nil
Placeholderbooleanfalse
Radiusnumber?nil
Heightnumber34 (min 18)
SizeUDim2?UDim2.new(1, -7, 0, Height)
Visiblebooleantrue
LayoutOrdernumber?nil

Return object methods: SetTitle(newTitle), SetVisible(visible), Destroy().

Button APIs

Window:SideBarButton(config)
Aliases: Window.SidebarButton, Window.Button

Config:

KeyTypeDefault
Title / Textstring"Button"
Iconstring?nil
Callbackfunction?nil
Variantstring"Secondary"
FullRoundedboolean?nil
Radiusnumber?nil
Heightnumber34 (min 20)
SizeUDim2?UDim2.new(1, -7, 0, Height)
Visiblebooleantrue
LayoutOrdernumber?nil

Return object methods: SetTitle(newTitle), SetCallback(callback), SetVisible(visible), Destroy().

Space APIs

Window:SideBarSpace(config)
Aliases: Window.SidebarSpace, Window.Space

Config:

KeyTypeDefault
Columnsnumber1

Return value: a Frame (Space.ElementFrame), not a method-rich object.

Divider APIs

Window:Divider(config) creates a sidebar divider.
Aliases: Window:SideBarDivider(config), Window.SidebarDivider.

Config is the same as the Divider element config above.

Return value: divider Frame only (for runtime method access, use Tab:Divider(...) instead).

Full Example (Sidebar Elements)

local sbLabel = Window:SideBarLabel({
    Title = "Quick Actions",
    Icon = "sparkles",
})

local sbButton = Window:SideBarButton({
    Title = "Recenter",
    Icon = "locate-fixed",
    Variant = "Secondary",
    Callback = function()
        Window:SetToTheCenter()
    end,
})

local sbSpaceFrame = Window:SideBarSpace({
    Columns = 2,
})

local sbDividerFrame = Window:SideBarDivider({
    Title = "Tools",
    TitleAlignment = "Left",
})

sbLabel:SetTitle("Quick Tools")
sbLabel:SetVisible(true)

sbButton:SetTitle("Center Window")
sbButton:SetCallback(function()
    WindUI:Notify({
        Title = "Window",
        Content = "Centered",
    })
    Window:SetToTheCenter()
end)
sbButton:SetVisible(true)

task.delay(20, function()
    sbLabel:Destroy()
    sbButton:Destroy()
    sbSpaceFrame:Destroy()
    sbDividerFrame:Destroy()
end)

On this page