For the chips you can see I broke it down into 2 separate components “TeamChip” and “PlayerChip” and I just use Roact.createElement() in the main leaderboard handler to actually create the 2 chips. This is what the code looks like in both of them:
PlayerChip:
local Roact = require(game.ReplicatedStorage.Shared.Dependencies.roact)
local function PlayerChip(props)
return Roact.createElement("Frame", {
Size = UDim2.fromScale(0.99, 0.061),
BackgroundColor3 = Color3.fromRGB(0, 0, 0),
BackgroundTransparency = 0.3,
LayoutOrder = props.LayoutOrder,
}, {
UIAspectRatioConstraint = Roact.createElement("UIAspectRatioConstraint", {
AspectRatio = 11.76,
}),
UICorner = Roact.createElement("UICorner", {
CornerRadius = UDim.new(0, 2),
}),
UIPadding = Roact.createElement("UIPadding", {
PaddingLeft = UDim.new(0.04, 0),
}),
InformationOpen = Roact.createElement("TextButton", {
Text = "",
BackgroundTransparency = 1,
Position = UDim2.fromScale(-0.043, 0),
Size = UDim2.fromScale(1.043, 1),
[Roact.Event.Activated] = function()
if props.onActivated then
props.onActivated()
end
end,
}),
PlayerName = Roact.createElement("TextLabel", {
Position = UDim2.fromScale(0, 0),
Size = UDim2.fromScale(0.67, 1),
Text = props.PlayerName,
TextScaled = true,
TextColor3 = Color3.fromRGB(255, 255, 255),
FontFace = Font.new("rbxasset://fonts/families/PressStart2P.json", Enum.FontWeight.Regular),
BackgroundTransparency = 1,
TextXAlignment = Enum.TextXAlignment.Left,
}, {
UIAspectRatioConstraint = Roact.createElement("UIAspectRatioConstraint", {
AspectRatio = 7.57,
}),
}),
Parameter1 = Roact.createElement("TextLabel", {
Position = UDim2.fromScale(0.639, 0),
Size = UDim2.fromScale(0.171, 1),
Text = props.Level,
TextScaled = true,
TextColor3 = Color3.fromRGB(255, 255, 255),
FontFace = Font.new("rbxasset://fonts/families/PressStart2P.json", Enum.FontWeight.Regular),
BackgroundTransparency = 1,
}, {
UIAspectRatioConstraint = Roact.createElement("UIAspectRatioConstraint", {
AspectRatio = 1.935,
}),
UITextSizeConstraint = Roact.createElement("UITextSizeConstraint", {
MaxTextSize = 25,
MinTextSize = 1,
}),
}),
Parameter2 = Roact.createElement("TextLabel", {
Position = UDim2.fromScale(0.826, 0),
Size = UDim2.fromScale(0.171, 1),
Text = props.XP,
TextScaled = true,
TextColor3 = Color3.fromRGB(255, 255, 255),
FontFace = Font.new("rbxasset://fonts/families/PressStart2P.json", Enum.FontWeight.Regular),
BackgroundTransparency = 1,
}, {
UIAspectRatioConstraint = Roact.createElement("UIAspectRatioConstraint", {
AspectRatio = 1.935,
}),
UITextSizeConstraint = Roact.createElement("UITextSizeConstraint", {
MaxTextSize = 25,
MinTextSize = 1,
}),
}),
})
end
return PlayerChip```
TeamChip:
```lua
local Roact = require(game.ReplicatedStorage.Shared.Dependencies.roact)
local function TeamSeperator(props)
return Roact.createElement("Frame", {
Size = UDim2.fromScale(0.99, 0.046),
BackgroundTransparency = 0.3,
BackgroundColor3 = props.BackgroundColor3,
LayoutOrder = props.LayoutOrder,
BorderSizePixel = 0,
}, {
UIAspectRatioConstraint = Roact.createElement("UIAspectRatioConstraint", {
AspectRatio = 15.474,
}),
UIPadding = Roact.createElement("UIPadding", {
PaddingLeft = UDim.new(0.04, 0),
}),
TeamName = Roact.createElement("TextLabel", {
Position = UDim2.fromScale(0, 0),
Size = UDim2.fromScale(0.32, 1),
Text = props.TeamName,
TextScaled = true,
TextColor3 = Color3.fromRGB(255, 255, 255),
FontFace = Font.new("rbxasset://fonts/families/PressStart2P.json", Enum.FontWeight.Regular),
BackgroundTransparency = 1,
TextXAlignment = Enum.TextXAlignment.Left,
}, {
UIAspectRatioConstraint = Roact.createElement("UIAspectRatioConstraint", {
AspectRatio = 4.749,
}),
}),
})
end
return TeamSeperator
Hope that helps 