Skip to content

Commit f80e4cb

Browse files
authored
Add search bar
Signed-off-by: GitHub <noreply@github.com>
1 parent 0f76598 commit f80e4cb

2 files changed

Lines changed: 59 additions & 0 deletions

File tree

src/Components/SearchBar.luau

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
--!strict
2+
3+
local React = require("../Packages/React")
4+
local constants = require("../Constants")
5+
6+
local function SearchBarTextBox()
7+
return React.createElement("Frame", {
8+
Size = UDim2.new(0, 190, 0, 30),
9+
BackgroundColor3 = constants.theme.backgroundColor,
10+
BackgroundTransparency = constants.theme.containerBackgroundTransparency,
11+
}, {
12+
React.createElement("UICorner", {
13+
CornerRadius = constants.theme.cornerRadiusSmall,
14+
}),
15+
}, {
16+
React.createElement("UIPadding", {
17+
PaddingBottom = constants.theme.paddingLarge,
18+
PaddingLeft = constants.theme.paddingLarge,
19+
PaddingRight = UDim.new(0, 28),
20+
PaddingTop = constants.theme.paddingLarge,
21+
}),
22+
}, {
23+
React.createElement("UIStroke", {
24+
ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
25+
Color = constants.theme.containerStrokeColor,
26+
Transparency = constants.theme.containerStrokeTransparency,
27+
}),
28+
}, {
29+
React.createElement("TextBox", {
30+
BackgroundTransparency = 1,
31+
Size = UDim2.new(1, 0, 1, 0),
32+
Font = constants.theme.font,
33+
Text = "",
34+
PlaceholderText = "Search",
35+
TextColor3 = constants.theme.textColor,
36+
TextSize = constants.theme.textSize,
37+
TextStrokeTransparency = constants.theme.textStrokeTransparency,
38+
TextStrokeColor3 = constants.theme.textStrokeColor,
39+
TextXAlignment = Enum.TextXAlignment.Left,
40+
}),
41+
})
42+
end
43+
44+
return SearchBarTextBox

src/Stories/SearchBar.story.luau

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--!strict
2+
3+
local React = require("../Packages/React")
4+
local ReactRoblox = require("../Packages/ReactRoblox")
5+
6+
local SearchBar = require("../Components/SearchBar")
7+
8+
return {
9+
summary = "A search bar for finding tools",
10+
react = React,
11+
reactRoblox = ReactRoblox,
12+
story = function()
13+
return React.createElement(SearchBar)
14+
end,
15+
}

0 commit comments

Comments
 (0)