Skip to main content
skill CX Codex

roblox-ui · el4cteo — Claude Code skill: what it does, how to install

roblox-ui — a skill for Claude Code and Codex constructs responsive Roblox interfaces. Runs when building HUDs, inventories, storefronts, or fixing layouts across mobile devices and consoles.

MIT 1,300 installs ★ 131 updated 2026-11-03

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add EL4CTEO/roblox-skills --skill roblox-ui -a claude-code
Open on GitHub

What roblox-ui does

The skill produces client-side Luau interface code relying on ScreenGui, UDim2.fromScale, and layout constraints. Setups configure CoreUISafeInsets to avoid device notches, utilize UIListLayout with UIFlexItem for dynamic bars, and set engine-level token themes via StyleSheet.

Cross-platform interaction uses GuiButton.Activated across mouse, touch, and controller inputs rather than click listeners. Drag gestures rely on UIDragDetector because GuiObject.Draggable is deprecated. Pure Offset breaks interfaces on mobile displays and 4K monitors, requiring Scale for base dimensions. Text visible between players requires server-side checks with TextService:FilterStringAsync.

What it helps with

  • scale HUD layouts across mobile displays and 4K monitors
  • configure gamepad menu traversal with SelectionGroup
  • build dynamic inventory toolbars using UIListLayout
  • implement item dragging with UIDragDetector

Example prompts for the agent

  • Build an adaptive five-slot toolbar HUD inside StarterGui using UIListLayout
  • Configure ScreenInsets safe areas and center positioning for the shop frame
  • Set up gamepad navigation for the inventory menu using SelectionGroup and Activated

How to install roblox-ui

1Skills CLI (Vercel)

npx skills add EL4CTEO/roblox-skills --skill roblox-ui -a claude-code

2Manually: put the files in place

~/.claude/skills/roblox-ui/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/roblox-ui/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about roblox-ui

How to install roblox-ui in Claude Code?

Run npx skills add EL4CTEO/roblox-skills --skill roblox-ui -a claude-code. The definition is placed in ~/.claude/skills/roblox-ui/SKILL.md.

What does roblox-ui do?

It writes client-side Roblox Luau interface code incorporating safe areas, StyleSheet rules, TweenService motions, and cross-platform input bindings.

What is required for roblox-ui to work?

Interface code runs entirely on the client within StarterGui or PlayerGui, while shared user text requires TextService:FilterStringAsync on the server.

Source text

SKILL.md · MIT
---
name: roblox-ui
description: Responsive cross-platform UI - ScreenGui and safe areas (ScreenInsets), Scale vs Offset, UIListLayout flex/UIFlexItem, constraints, StyleSheets/tokens/themes, RichText, gamepad/touch navigation, UIDragDetector, CanvasGroup, tweens, BillboardGui/SurfaceGui, React-lua/Fusion/Vide. Use when building HUDs, menus, shops, inventories, or fixing UI that breaks on mobile, console, or other screen sizes.
---

# Roblox UI

## Foundations

- Put UI in `StarterGui` as `ScreenGui`s (copied to each player's `PlayerGui`), or create it from a
  client controller. UI code is client-only; the server never touches `PlayerGui` in normal designs.
- `ScreenGui` defaults to set: `ResetOnSpawn = false` (keep UI across deaths), `ZIndexBehavior = Sibling`,
  `IgnoreGuiInset` per design, `ScreenInsets = CoreUISafeInsets` for interactive UI (clears notches and
  the Roblox top bar); `DeviceSafeInsets`/`None` only for full-bleed backgrounds.
- **Size and position with Scale** (`UDim2.fromScale`) plus constraints; use Offset only for fixed
  details (padding, strokes, icons). Pure-Offset UI breaks on phones and 4K screens.
- `AnchorPoint = Vector2.new(0.5, 0.5)` + `Position = UDim2.fromScale(0.5, 0.5)` centers an element.
- `UIAspectRatioConstraint` keeps shapes square/consistent; `UISizeConstraint` caps sizes;
  `UITextSizeConstraint` with `TextScaled` bounds text size (prefer fixed `TextSize` + `AutomaticSize`
  where possible — `TextScaled` produces inconsistent sizes).
- `AutomaticSize` lets frames grow with content (lists, tooltips, chat bubbles).
- Test every screen in the **Device Simulator** (phone portrait/landscape, tablet, console 10-foot, 4K).

## Layout

| Need | Use |
| --- | --- |
| Rows/columns that adapt | `UIListLayout` (`FillDirection`, `Padding`, `HorizontalFlex`/`VerticalFlex`, `Wraps`) |
| One item grows to fill space | `UIFlexItem` child with `FlexMode = Fill` (or `Grow`/`Shrink`/`Custom`) |
| Grids (inventory) | `UIGridLayout` inside a `ScrollingFrame` with `AutomaticCanvasSize` |
| Carousels/pages | `UIPageLayout` |
| Rounded corners, borders, padding | `UICorner`, `UIStroke`, `UIPadding` |
| Gradients, shadows | `UIGradient` (`Type` = `Linear`/`Radial`/`Conical`/`Elliptical`), `UIShadow` |
| Scale a whole group | `UIScale` |

```luau
--!strict
local Players = game:GetService("Players")

local playerGui = Players.LocalPlayer:WaitForChild("PlayerGui")

local screenGui = Instance.new("ScreenGui")
screenGui.Name = "Hud"
screenGui.ResetOnSpawn = false
screenGui.ScreenInsets = Enum.ScreenInsets.CoreUISafeInsets

local bar = Instance.new("Frame")
bar.Name = "Toolbar"
bar.AnchorPoint = Vector2.new(0.5, 1)
bar.Position = UDim2.new(0.5, 0, 1, -16)
bar.Size = UDim2.fromScale(0.6, 0.1)
bar.BackgroundTransparency = 0.3
bar.Parent = screenGui

local list = Instance.new("UIListLayout")
list.FillDirection = Enum.FillDirection.Horizontal
list.HorizontalFlex = Enum.UIFlexAlignment.Fill -- slots share the width equally
list.Padding = UDim.new(0, 8)
list.Parent = bar

Instance.new("UICorner").Parent = bar
local padding = Instance.new("UIPadding")
padding.PaddingLeft, padding.PaddingRight = UDim.new(0, 8), UDim.new(0, 8)
padding.Parent = bar

for slot = 1, 5 do
	local button = Instance.new("TextButton")
	button.Name = `Slot{slot}`
	button.Text = tostring(slot)
	button.Size = UDim2.fromScale(0, 1)
	button.Parent = bar
	Instance.new("UIAspectRatioConstraint").Parent = button
end

screenGui.Parent = playerGui -- parent last: one layout pass, no flicker
```

## Styling: StyleSheets (CSS-like)

Roblox's engine-level styling replaces copy-pasted property values:
- `StyleSheet` with `StyleRule`s (`Selector` like `"TextButton"`, `".Primary"` (tag), `"#Close"` (name),
  `"TextButton:Hover"` (state), `"::UICorner"` (modifier pseudo-instance)) and `rule:SetProperties({...})`.
- **Tokens** are attributes on a token sheet (`$Primary`, `$Radius`); **themes** are sheets deriving tokens
  (`StyleDerive`); swap themes by retargeting the `StyleDerive`.
- A `StyleLink` under a `ScreenGui` applies one sheet to that tree. **Style queries** (`@Name`) switch
  styles by screen size, input type, or accessibility settings.
- Edit visually in Studio's **Style Editor**. Details and a code example: [references/styling-and-frameworks.md](references/styling-and-frameworks.md).

## Cross-platform input in UI

- Read `UserInputService.PreferredInput` (`KeyboardAndMouse`, `Touch`, `Gamepad`) and listen to
  `UserInputService:GetPropertyChangedSignal("PreferredInput")` to swap button prompts and layouts.
  Don't infer platform from `TouchEnabled`/`KeyboardEnabled` alone.
- Use `GuiButton.Activated` (works for mouse, touch, and gamepad) instead of `MouseButton1Click`.
- Gamepad/console: every interactive element `Selectable`, set `GuiService.SelectedObject` when a menu
  opens, group with `SelectionGroup`/`NextSelection*` for predictable D-pad navigation, support `ButtonB`
  to close. Minimum touch target ≈ 44×44 px; readable text ≥ 14 px on phones.
- Bind actions through the **Input Action System** (`InputBinding.UIButton` makes an on-screen button
  trigger an action) — see `roblox-input`.

## Text

- `RichText = true` enables `<b>`, `<i>`, `<font color="#FF0">`, `<stroke>`, etc. Escape user text.
- **Any text from one player shown to another must be filtered** with `TextService:FilterStringAsync`
  on the server (`roblox-text-chat`). That includes pet names, signs, guild names, trade notes.
- Use `FontFace = Font.new("rbxasset://fonts/families/GothamSSm.json", Enum.FontWeight.Bold)` for weights.
- Localize with `LocalizationTable`s and auto-translation; avoid baking text into images.

## Animation and feel

- Tween on the client: `TweenService:Create(frame, TweenInfo.new(0.2, Enum.EasingStyle.Quad), { Position = ... }):Play()`.
- Animate `UIScale.Scale` for pop effects rather than `Size` (keeps layout stable).
- `CanvasGroup` fades a whole subtree (`GroupTransparency`) but renders to a texture: use it for
  fading panels, not for large always-visible UI (memory/quality cost).
- `ClipsDescendants` now clips **rotated** children and `Path2D` too (default since Sep 24, 2026;
  `StarterGui.ClipsDescendantsSupportsRotation` opt-out is removed in November 2026). To keep a rotated child
  unclipped, make it a sibling with a higher `ZIndex`. A rotated parent still clips only inside a `CanvasGroup`.
- Drag-and-drop: `UIDragDetector` (the deprecated `GuiObject.Draggable` no longer works for new work).

## World-space UI

- `BillboardGui` (faces camera: names, health bars) — set `MaxDistance`, `AlwaysOnTop` sparingly,
  use `Size` in Scale for distance scaling; `SurfaceGui` for screens/signs on parts. Prefer
  `Adornee` + keep them in `PlayerGui` for per-player content. They stop rendering when their part streams out.
- `ProximityPrompt` gives cross-platform interaction UI for free (validate on the server!).

## Frameworks

For more than a few screens, a declarative framework keeps state and UI in sync:
- **React** (`jsdotlua/react` + `react-roblox`) — components + hooks, familiar to web devs, scales to big apps.
- **Fusion** — reactive state objects and declarative instance creation.
- **Vide** — small, fast reactive library.
Match whatever the project already uses. Keep game state in controllers; UI only renders it and
emits user intents.

## Performance

- Avoid updating text/properties every frame when values haven't changed.
- Hide closed menus with `Visible = false` (or `Enabled = false` on the ScreenGui) instead of
  destroying/recreating them repeatedly; build large lists lazily or virtualize them.
- Too many `UIGradient`/`CanvasGroup`/`UIStroke` on dynamic UI costs frame time; check the MicroProfiler.

## Related skills

`roblox-input` (actions, gamepad), `roblox-text-chat` (filtering), `roblox-monetization` (shops),
`roblox-luau`, `roblox-performance`.

© EL4CTEO · MIT · EL4CTEO/roblox-skills

Similar skills

All skills for Frontend and UI →

roblox-ui by other authors comes first.

roblox-ui gamedev-skills roblox-ui — a Claude Code skill for building Roblox interfaces that scale across phones and handle gamepads. CX Codex +1 9,900installs roblox-ui-builder LihFolk roblox-ui-builder is a Claude Code skill that builds and audits responsive Roblox interfaces. It triggers on menu creation, HUD adjustments, or layout fixes for handheld devices. CX Codex +1 ★ 98repo stars roblox-user-interfaces nonlooped roblox-user-interfaces helps build and debug Roblox menus, HUD overlays, and world-space interfaces like SurfaceGui and BillboardGui. CX Codex +1 612installs roblox-gui TabooHarmony roblox-gui is a Claude Code skill for responsive Roblox UI development across mobile and console. It helps build HUDs and menus without layout bugs. CX Codex +1 3,700installs roblox-luau gamedev-skills This Claude Code skill helps write Roblox Luau and run project checks. It activates for a LocalScript that will not run, a client-side nil after joining, or legacy wait() calls. CX Codex +1 12,300installs roblox-datastores gamedev-skills A skill for Claude Code automates Roblox DataStoreService persistence, profile loading, and conflict prevention. Use it when player data goes missing or items duplicate after teleportation. CX Codex +1 11,400installs roblox-building TabooHarmony roblox-building — a skill for building geometry, maps and props in Roblox Studio through MCP or plain Luau. It keeps you from guessing coordinates and pushes each build to a verifiable result. CX Codex +1 4,200installs

From the same set22

The whole set →
roblox-security roblox-security — a skill for Claude Code enforces server-authoritative security for Roblox experiences. Runs during reviews of remote event handlers, combat calculations, inventory transactions, and character physics. CX Codex +1 1,300installs roblox-characters-animation roblox-characters-animation — a Claude Code skill for Roblox characters and animation. It applies to work on movement, damage, respawns, avatars, weapons, and tweens. CX Codex +1 1,300installs roblox-game-systems roblox-game-systems — a skill for Claude Code and Codex providing server-authoritative Roblox gameplay recipes. Activates when building currencies, inventory, weapons, round loops, or progression. CX Codex +1 1,300installs roblox-luau The roblox-luau Claude Code skill supports writing and explaining Roblox scripts in Luau. It activates for script creation, refactoring, type-error fixes, and updates to older Lua code. CX Codex +1 1,300installs roblox-testing The roblox-testing Claude Code skill covers testing Roblox code and checking gameplay changes. It applies when adding tests, configuring a runner, or setting up CI. CX Codex +1 1,300installs roblox-open-cloud This Claude Code skill covers Roblox Open Cloud APIs and HttpService. It applies to external tools, bots, CI/CD, and web requests from a game. CX Codex +1 1,200installs roblox-text-chat roblox-text-chat is a Claude Code and Cursor skill that configures TextChatService and text filtering in Roblox for adding chat, commands, or player-authored signs. CX Codex +1 1,200installs roblox-monetization This Claude Code skill covers Roblox monetization and purchase troubleshooting. It activates for work on shops, passes, subscriptions, rewarded ads, or paid random items. CX Codex +1 1,200installs

Project sponsors

Companies that keep this analytics open