Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
6548bbb
rewrite: started porting from Typescript to Luau
Mon4ik Apr 23, 2025
8ff76b1
fix: removed .github, .neoconf.json, added check to README.md
Mon4ik Apr 23, 2025
23b88bf
feat: `TextLabel` and `TextButton`
Mon4ik Apr 24, 2025
aad02d0
feat: darklua, scripts/, script to build wally package
Mon4ik Apr 25, 2025
7873c13
fix: fixed development environment, fixed requires
Mon4ik Apr 25, 2025
3b7a1b8
fix: refactored code, switched to old type-solver*, added UIStroke(Bo…
Mon4ik Apr 27, 2025
4a352f0
feat: `UICorner` and `UIStroke`
Mon4ik Apr 27, 2025
c01c5ee
feat: Padding and aspect ratio
Mon4ik Apr 29, 2025
0cb48ba
feat: `UISizeConstraint` and `UITextSizeConstraint`
Mon4ik May 1, 2025
ccfa986
docs: added and sorted support
Mon4ik May 3, 2025
67ccbb6
feat: `UIListLayout`
Mon4ik May 3, 2025
2c1990c
feat: `UIFlexItem`
Mon4ik May 4, 2025
efe51f7
refactor: refactored building scripts/files, added roblox model building
Mon4ik May 4, 2025
43888d1
fix: capitalized `Stories/`, moved components
Mon4ik May 4, 2025
b7ef481
feat: added `TextButton` story, added alias `@root` for resolving roo…
Mon4ik May 4, 2025
9f915ec
fix: removed default border
Mon4ik May 4, 2025
f1dadf5
style: formatted using stylua
Mon4ik May 4, 2025
d1d2ba7
feat: `ScreenGui`
Mon4ik May 4, 2025
000ff95
feat: `ScrollingFrame`
Mon4ik May 4, 2025
a49238b
refactor: removed some builder (because they not needed), exported al…
Mon4ik May 5, 2025
e304f11
feat: add `CalculateAspectRatio` util, add `React.forwardRef` in buil…
Mon4ik Aug 16, 2025
5f5b7dd
feat: added `collections` as dependency, added todos example
Mon4ik Aug 16, 2025
7ded956
feat: `TextBox`
Mon4ik Aug 16, 2025
fb77e1d
build: update/reformat Makefile and scripts
Mon4ik Aug 16, 2025
e7696e9
feat: add (almost) all `GuiObject` props
Mon4ik Aug 16, 2025
3f4b4a6
feat: removed `SafeAreaCompatibility` in ScreenGui, added `Settings` …
Mon4ik Aug 17, 2025
cadc632
feat: added all props of `Text*` elements
Mon4ik Aug 17, 2025
8083be7
docs: add more todos
Mon4ik Aug 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .darklua-dev.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"rules": [
{
"rule": "convert_require",
"current": {
"name": "path",
"sources": {
"@pkg": "Packages",
"@dev-pkg": "DevPackages",
"@root": "src"
}
},
"target": {
"name": "roblox",
"rojo_sourcemap": "./sourcemap.json",
"indexing_style": "wait_for_child"
}
}
]
}
19 changes: 19 additions & 0 deletions .darklua-roblox.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"rules": [
{
"rule": "convert_require",
"current": {
"name": "path",
"sources": {
"@pkg": "Packages",
"@root": "src"
}
},
"target": {
"name": "roblox",
"rojo_sourcemap": "./sourcemap.json",
"indexing_style": "wait_for_child"
}
}
]
}
19 changes: 19 additions & 0 deletions .darklua-wally.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"rules": [
{
"rule": "convert_require",
"current": {
"name": "path",
"sources": {
"@pkg": "Packages",
"@root": "src"
}
},
"target": {
"name": "roblox",
"rojo_sourcemap": "./sourcemap.json",
"indexing_style": "wait_for_child"
}
}
]
}
19 changes: 0 additions & 19 deletions .github/dependabot.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/build.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/release.yml

This file was deleted.

14 changes: 6 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
/node_modules
/out
/include
Packages/
DevPackages/
out/

sourcemap.json

.DS_Store
*.tsbuildinfo
*.log

# development tarballs
rbxts-better-react-components-*.tgz
package.tgz
*.old
7 changes: 7 additions & 0 deletions .luaurc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"aliases": {
"pkg": "./Packages",
"dev-pkg": "./DevPackages",
"root": "./src"
}
}
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

29 changes: 29 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.PHONY: install cleanup install-toolchain cleanup-build serve watch build/*

install:
aftman install

cleanup:
git clean -Xf build # remove ignored files in build/

serve:
rojo serve out.project.json

watch: Packages/ DevPackages/ sourcemap.json .darklua-dev.json
darklua process -w -c .darklua-dev.json src out

# files/folders

build/roblox:
./scripts/roblox.sh

build/wally:
./scripts/wally.sh

Packages DevPackages: wally.toml wally.lock
wally install
wally-package-types --sourcemap sourcemap.json Packages/
wally-package-types --sourcemap sourcemap.json DevPackages/

sourcemap.json: src/* default.project.json
rojo sourcemap default.project.json --output sourcemap.json
124 changes: 60 additions & 64 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,83 +1,79 @@
# Better React Components
# better-react-components

![NPM Downloads](https://img.shields.io/npm/dm/%40rbxts%2Fbetter-react-components?style=for-the-badge)
![NPM Version](https://img.shields.io/npm/v/%40rbxts%2Fbetter-react-components?style=for-the-badge)
Roblox UI elements, but with builtin modifiers

Roblox's ui elements, with builtin modifiers
> [!NOTE]
>
> Currently, I am rewriting this library from Typescript to Lua.
>
> I'll still publish this library to NPM.

Also see **[introduction](docs/1_Introduction.md)**
## Setup guide

## Example
```
Dear Future Me.

![Comperance](docs/better-react-components-is-based.png)
Please, publish and write here, how to install this library from wally or npm

<details>
<summary>better-react-components code</summary>
Respectfully,
Past Me
```

```
<Frame
position={new UDim2(.5, 0, .5, 0)}
size={new UDim2(.5, 0, .5, 0)}
## Development & Build from Scratch

anchorPoint={AnchorPoints.Middle}
cornerRadius={8}
padding={4}
>
<GridLayout
cellSize={new UDim2(.25, 0, .25, 0)}
cellPadding={new UDim2(0, 4, 0, 4)}
cellAspectRatio={1}
/>
1. Install Aftman and Make
2. Run:
```
make install # installs toolchain

# Development stuff:
make watch # starts darklua's processer
make serve # starts rojo server

<DummyElement />
<Button
textColor={"#64FEE7"}
text="Hello world!"
/>
<Text
background={"#64FEE7"}
text="Hello there!"
font={Enum.Font.Arial}
/>
</Frame>;
```
</details>
# Buildin' stuff:
make wally-package # builds wally package at `build/wally/`
make roblox-package # builds roblox model file at `build/wally/better-react-components.rbxmx`
```


## Support

### TODO

- [ ] Upgrade ESLint to `9.*.*` version
- [ ] Better documentation
## Supported Components/Modifiers

### Components

- [X] Frame
- [X] ScrollableFrame
- [X] Button
- [ ] CanvasGroup
- [x] Frame
- [ ] ImageButton
- [X] Image
- [X] Text
- [X] TextBox
- [X] CanvasGroup
- [x] TextButton
- [ ] ImageLabel
- [x] TextLabel
- [x] ScrollingFrame
- [x] TextBox
- [ ] VideoDisplay
- [ ] VideoFrame
- [ ] ViewportFrame
- [ ] LayerCollector
- [ ] BillboardGui
- [x] ScreenGui
- [ ] SurfaceGui
- [ ] Path2D

### Modifiers

- [X] UIAspectRatioConstraint
- [X] UICorner
- [X] UIGradient
- [X] UIGridLayout [(see GridLayout)](src/components/GridLayout.tsx)
- [X] UIListLayout [(see ListLayout)](src/components/ListLayout.tsx)
- [X] UIFlexLayout [(see ListLayout)](src/components/ListLayout.tsx)
- [X] UIPadding
- [ ] UIPageLayout
- [X] UIScale
- [X] UISizeConstraint
- [X] UIStroke
- [ ] UITableLayout
- [X] UITextSizeConstraint
- [x] UIConstraint
- [x] UIAspectRatioConstraint
- [x] UISizeConstraint
- [x] UITextSizeConstraint
- [x] UICorner (`CornerRadius` property)
- [ ] UIDragDetector
- [ ] UIGradient
- [x] UIPadding
- [ ] UIScale
- [x] UIStroke (`Border` property)


### Custom Modifiers
### Layouts

- ~~[ ] FlowLayout [(view)](https://devforum.roblox.com/t/flow-flexbox-layout-for-lua/2614394)~~ (Removed due release of flex features to ListLayout. [Devforum](https://devforum.roblox.com/t/flex-features-for-uilistlayout-client-release/3096190) )
- [ ] UIGridLayout
- [x] UIListLayout
- [x] UIFlexItem
- [ ] UITableLayout
- [ ] UIPageLayout
10 changes: 4 additions & 6 deletions aftman.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# This file lists tools managed by Aftman, a cross-platform toolchain manager.
# For more information, see https://github.com/LPGhatguy/aftman

# To add a new tool, add an entry to this table.
[tools]
rojo = "rojo-rbx/rojo@7.4.1"
# rojo = "rojo-rbx/rojo@6.2.0"
rojo = "rojo-rbx/rojo@7.4.4"
wally = "UpliftGames/wally@0.3.2"
wally-package-types = "JohnnyMorganz/wally-package-types@1.4.2"
darklua = "seaofvoices/darklua@0.16.0"
10 changes: 10 additions & 0 deletions build/roblox/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This folder used for storing Roblox package files
#
# `default.project.json` is used for generating sourcemap.json and building .rbxmx file
#
# To build roblox package run:
# $ make roblox-package

*
!.gitignore
!default.project.json
9 changes: 9 additions & 0 deletions build/roblox/default.project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "better-react-components",
"tree": {
"_Vendor": {
"$path": "Packages"
},
"$path": "src"
}
}
11 changes: 11 additions & 0 deletions build/wally/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This folder used for storing Wally package files
#
# `sourcemap.project.json` is used for generating sourcemap.json
#
# To build wally package run:
# $ make wally-package

*
!.gitignore
!default.project.json
!sourcemap.project.json
Loading