Skip to content

Commit 6509cba

Browse files
authored
Add background frame
Signed-off-by: GitHub <noreply@github.com>
1 parent 3eb2f4d commit 6509cba

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

src/Components/Background.luau

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--!strict
2+
3+
local React = require("../Packages/React")
4+
local constants = require("../Constants")
5+
6+
local function BackgroundFrame(props: {
7+
Size : UDim2,
8+
child: () -> (),
9+
})
10+
return React.createElement("Frame", {
11+
BackgroundColor3 = constants.theme.backgroundColor,
12+
BackgroundTransparency = constants.theme.backgroundTransparency,
13+
Size = props.Size,
14+
}, {
15+
React.createElement("UICorner", {
16+
CornerRadius = constants.theme.cornerRadius,
17+
}),
18+
})
19+
end
20+
21+
return BackgroundFrame

src/Stories/Background.story.luau

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--!strict
2+
3+
local React = require("../Packages/React")
4+
local ReactRoblox = require("../Packages/ReactRoblox")
5+
6+
local Background = require("../Components/Background")
7+
8+
return {
9+
summary = "Base background frame",
10+
react = React,
11+
reactRoblox = ReactRoblox,
12+
story = function()
13+
return React.createElement(Background, {
14+
Size = UDim2.new(0, 200, 0, 200),
15+
})
16+
end,
17+
}

0 commit comments

Comments
 (0)