Skip to Content
Kinemium

ImageButton

A clickable button that displays an image.

ImageButton combines the image properties of ImageLabel with the button behavior of GuiButton. It supports the Activated event and automatic hover and press coloring.

Getting started

local button = Instance.new("ImageButton")
button.Size = UDim2.fromOffset(72, 72)
button.Image = "rbxassetid://1234567890"
button.Parent = screenGui

button.Activated:Connect(function()
    print("icon clicked")
end)

Image properties

ImageButton exposes the same image members as ImageLabel:

PropertyTypeAccessDescription
ImagestringRead/writeImage asset URI.
ImageTransparencynumberRead/writeTransparency, clamped to 0 through 1.
ImageColor3Color3Read/writeTint applied to the image.
ImageRectOffsetVector2Read/writeSource rectangle offset.
ImageRectSizeVector2Read/writeSource rectangle size.
ResampleModeEnum.ResampleModeRead/writeFiltering when scaled.
ScaleTypeEnum.ScaleTypeRead/writeStretch, tile, or slice behavior.
SliceCenterRectRead/writeNine-slice border rectangle.
SliceScalenumberRead/writeNine-slice border scale, minimum 0.
TileSizeUDim2Read/writeTile size for tiled scaling.

Button behavior

ImageButton inherits from GuiButton, so it has the button members, including AutoButtonColor, Modal, Selected, and the Activated event.

With automatic button color enabled, the image tints brighter on hover and darker while pressed.

Notes

  • IsLoaded isn't part of the public property list on this class.
  • Activated fires on a completed click, including touch input.
  • The image properties are stored on the button itself; there's no child label instance.
  • Inherits all GuiObject members.

See also

  • ImageLabel for a non-clickable image.
  • TextButton for a text-based button.
  • GuiObject for shared GUI members.

On this page