Skip to content

InkImmediate-mode UI for Roblox

Roblox UI beyond instance trees

Ink

A button in a few lines ​

luau
const function button(s: ink.Scope, label: string): (ink.Composite, boolean)
	local content = ink.text(label, STYLE)
	content = ink.pad(content, ink.edges.xy(16, 8))

	const hit = ink.hit_region(s:key("hit"), content.bounds)
	const color = ink.tween(s:key("color"), if hit.state == Enum.GuiState.Hover then HOVER else IDLE, 0.2)

	local bg = ink.solid(content.bounds, color)
	bg = ink.round(bg, ink.corners.all(8))

	return ink.compose({ bg, content, hit }), hit.clicked
end
luau
const play, play_clicked = button(s:key("play"), "Play")
const quit, quit_clicked = button(s:key("quit"), "Quit")

return ink.align(ink.v_stack({ play, quit }, 8), screen, ink.ALIGN_MID, ink.ALIGN_MID)