CustomActionObject (CAO) is a lightweight module designed to give developers full control over the visual style of mobile buttons created by ContextActionService.
Since Roblox hasn’t updated the look of mobile buttons in a long time, I created this module to make it easier to customize and restyle them the way you want.
https://create.roblox.com/store/asset/117099778644311/CustomActionObject
Examples
Without module
Template for Custom Buttons
Basic Usage
local ContextActionService = game:GetService("ContextActionService")
local CAO = require(game.ReplicatedStorage.CustomActionObject)
-- Bind your mobile action
ContextActionService:BindAction("Sprint", function() end, true)
ContextActionService:SetPosition("Sprint", UDim2.new(.7, 0, -0.2, 0))
ContextActionService:SetTitle("Sprint", "Sprint")
-- Apply default style to the button
CAO.default(ContextActionService:GetButton("Sprint"))
API Reference
Functions
.default(button)
CAO.default(ContextActionService:GetButton("Button"))
Apply the default button style
.custom(…)
CAO.custom(ContextActionService:GetButton("Button"),
ContextImage:AssetID,
ContextTransparency: number,
ContextColor3: Color3,
ActionTransparency: number,
ActionColor3: Color3,
TextFont: Font)
Fully customizable context button styling
.SetProfile(…)
CAO.SetProfile(ContextActionService:GetButton("Button"),
Profile: ModuleScript,)
Using custom profiles/presets
.legacy(button)
CAO.default(ContextActionService:GetButton("Button"))
Apply legacy default use two image button design
.custom_legacy(…)
CAO.custom_legacy((ContextActionService:GetButton("Button"),
ContextImageDefault:AssetID,
ContextImagePressed:AssetID,
ContextTransparency: number,
ContextColor3: Color3,
ActionTransparency: number,
ActionColor3: Color3,
TextFont: Font)
Mix of legacy behavior with full customization
Methods
:SetButtonSize(number)
local default = CAO.default(ContextActionService:GetButton("Button"))
default:SetButtonSize(number)
Set button size in pixel
:SetContextColor(Color3)
local default = CAO.default(ContextActionService:GetButton("Button"))
default:SetContextColor(Color3)
Set the background (context) color of the button
:SetContextTransparency(number)
local default = CAO.default(ContextActionService:GetButton("Button"))
default:SetContextTransparency(number)
Set transparency of the button
:SetFont(font)
local default = CAO.default(ContextActionService:GetButton("Button"))
default:SetFont(font)
Set the font for the button’s text
:SetTextSize(number)
local default = CAO.default(ContextActionService:GetButton("Button"))
default:SetTextSize(number)
Set the text size in pixel for the button’s text
:SetActionColor(Color3)
local default = CAO.default(ContextActionService:GetButton("Button"))
default:SetActionColor(color)
Set the color of the button’s text and icon
:SetActionTransparency(number)
local default = CAO.default(ContextActionService:GetButton("Button"))
default:SetActionTransparency(number)
Set transparency for icon and text label
:SetEnabled(value:boolean)
local default = CAO.default(ContextActionService:GetButton("Button"))
default:SetEnabled(value:boolean)
You can disable or enable the button
:Destroy()
local default = CAO.default(ContextActionService:GetButton("Button"))
default:Destroy()
Just removes the button lol
License
This module is released under the Mozilla Public License Version 2.0 (MPL-2.0). You’re free to use it in any project, including commercial ones. The only requirement is that if you modify the source code of this module, you must publish your changes under the same license and give credit to the original author.
This way, improvements stay open for the community, and original authorship is respected.
Feedback
This is my first ever module script and the first version of the module itself, so go easy on me ![]()
I’m open to feedback, ideas, or bug reports — feel free to share! ![]()
Credits
Created by MBAID
Inspired to create this module by M100 (Micamaster100) — whose work and ideas sparked the original motivation.
Also influenced by TopBarPlus for its clean API and modular structure.













