Skip to content

AppBarButton

AppBarButton is a class inherited from IconButton, compared to its ancestor, AppBarButton is an infographic-only button with proper styling to fit in the TopAppBar or BottomAppBar component.

Usage

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

local iconState = Fusion.Value(Icons.album)

Lydie.Components.Controls.AppBarButton {
    Icon = iconState, -- (1)!

    OnClick = function() -- (2)!
        print("Hello, world!")
    end,
}
  1. Icon property accepts both a string of a state-wrapped string. The string should be either the asset URL or the ID of the image. Lydie has provided a list of icons from Lucide Icons for basic usage. Spritesheet-based icons are not supported at the moment.

  2. OnClick function will be invoked when InputEnded is fired and its input type matches either Enum.UserInputType.MouseButton1 or Enum.UserInputType.Touch. Due to how input events work in Roblox, input will sink no matter what. You should ensure the user is clicking the button before doing any further processing. See BaseButton.luau:69.

Properties

Name Description Required Default
Icon The asset URL/ID of the icon. ❌ Icons["loader-2"]
LayoutOrder The layout order of the button, used in a UIListLayout/UIGridLayout ✅ NaN

Functions

Name Description Required
OnClick: () -> () A function invoked when InputEnded is fired with matching input types Enum.UserInputType.MouseButton1 or Enum.UserInputType.Touch, where a user clicks the button and releases ❌