@rbxts/react-clean-ui 1.2.9 โ 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +15 -0
- package/README.md +111 -1
- package/out/Components/Input/Button.d.ts +1 -0
- package/out/Components/Input/Button.luau +3 -0
- package/package.json +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ShaderCloud
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,113 @@
|
|
|
1
1
|
# React Clean UI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An easy-to-use, theme-aware React component library for building polished Roblox interfaces with [`roblox-ts`](https://roblox-ts.com/) and [`@rbxts/react`](https://www.npmjs.com/package/@rbxts/react).
|
|
4
|
+
|
|
5
|
+
Stop hand-rolling sizes, spacing, colours, and layout on every screen โ compose your UI from reusable, styled components instead.
|
|
6
|
+
|
|
7
|
+
[**๐ Read the full docs**](https://shadercloud.github.io/rbxts-react-clean-ui/) ยท [**๐ฆ npm package**](https://www.npmjs.com/package/@rbxts/react-clean-ui)
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @rbxts/react-clean-ui
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Preview
|
|
16
|
+
|
|
17
|
+
| | | |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
|  |  |  |
|
|
20
|
+
|  |  |  |
|
|
21
|
+
|  |  |  |
|
|
22
|
+
|
|
23
|
+
More components, including layouts, forms, charts, and navigation, are in the [docs](https://shadercloud.github.io/rbxts-react-clean-ui/).
|
|
24
|
+
|
|
25
|
+
## Why React Clean UI?
|
|
26
|
+
|
|
27
|
+
Roblox gives you powerful low-level UI instances, but every screen ends up repeating the same work: calculating sizes and positions, configuring layout and spacing, applying colours/typography/corners/shadows, and keeping it all visually consistent.
|
|
28
|
+
|
|
29
|
+
React Clean UI moves that repeated work into reusable components, helpers, and theme definitions โ you describe **what** the interface should contain, the library handles **how** it's presented.
|
|
30
|
+
|
|
31
|
+
## Features
|
|
32
|
+
|
|
33
|
+
- ๐งฉ **Composable components** โ containers, stacks, boxes, buttons, text, fieldsets, inputs, selects, and more
|
|
34
|
+
- ๐จ **Theme-driven design** โ colours, spacing, typography, radii, and semantic intent colours (`primary`, `info`, `success`, `danger`) defined centrally; light/dark and custom themes supported
|
|
35
|
+
- ๐ **Familiar sizing & spacing** โ concise, CSS-like props translated into native Roblox `UDim`/`UDim2`
|
|
36
|
+
- ๐ฑ **Responsive layouts** โ breakpoint-aware components for phone, tablet, desktop, and console
|
|
37
|
+
- โ๏ธ **Built for Roblox React** โ renders ordinary Roblox GUI instances through `@rbxts/react`; plays nicely with hooks, contexts, Rojo, and UI Labs stories
|
|
38
|
+
|
|
39
|
+
## Quick start
|
|
40
|
+
|
|
41
|
+
First set up a roblox-ts project (`npm init roblox-ts`), then:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm install @rbxts/react-clean-ui
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
// src/client/demo.client.tsx
|
|
49
|
+
import React from "@rbxts/react";
|
|
50
|
+
import ReactRoblox from "@rbxts/react-roblox";
|
|
51
|
+
import { CleanUiProvider, DefaultTheme, Container, Box, VStack, HStack, FlexItem, Text, Button, Fieldset, Input, Select } from "@rbxts/react-clean-ui";
|
|
52
|
+
|
|
53
|
+
const playerGui = game.GetService("Players").LocalPlayer.WaitForChild("PlayerGui") as PlayerGui;
|
|
54
|
+
|
|
55
|
+
const screenGui = new Instance("ScreenGui");
|
|
56
|
+
screenGui.ResetOnSpawn = false;
|
|
57
|
+
screenGui.IgnoreGuiInset = true;
|
|
58
|
+
screenGui.Parent = playerGui;
|
|
59
|
+
|
|
60
|
+
const root = ReactRoblox.createRoot(screenGui);
|
|
61
|
+
|
|
62
|
+
root.render(
|
|
63
|
+
<CleanUiProvider theme={DefaultTheme}>
|
|
64
|
+
<Container width="90%" center>
|
|
65
|
+
<Box>
|
|
66
|
+
<VStack>
|
|
67
|
+
<Container>
|
|
68
|
+
<HStack>
|
|
69
|
+
<FlexItem>
|
|
70
|
+
<Text text="Basic Form" variant="title" />
|
|
71
|
+
</FlexItem>
|
|
72
|
+
<Button icon="times" />
|
|
73
|
+
</HStack>
|
|
74
|
+
</Container>
|
|
75
|
+
<Fieldset>
|
|
76
|
+
<Fieldset.Label>
|
|
77
|
+
<Text text="Enter Name:" />
|
|
78
|
+
</Fieldset.Label>
|
|
79
|
+
<Fieldset.Control>
|
|
80
|
+
<Input placeholder="John Doe" value="" />
|
|
81
|
+
</Fieldset.Control>
|
|
82
|
+
</Fieldset>
|
|
83
|
+
<Fieldset>
|
|
84
|
+
<Fieldset.Label>
|
|
85
|
+
<Text text="Country:" />
|
|
86
|
+
</Fieldset.Label>
|
|
87
|
+
<Fieldset.Control>
|
|
88
|
+
<Select>
|
|
89
|
+
<Select.Option text="United Kingdom" />
|
|
90
|
+
<Select.Option text="United States" />
|
|
91
|
+
<Select.Option text="Canada" />
|
|
92
|
+
</Select>
|
|
93
|
+
</Fieldset.Control>
|
|
94
|
+
</Fieldset>
|
|
95
|
+
<Container>
|
|
96
|
+
<Button text="Submit Form" intent="info" icon="arrow-circle-right" />
|
|
97
|
+
</Container>
|
|
98
|
+
</VStack>
|
|
99
|
+
</Box>
|
|
100
|
+
</Container>
|
|
101
|
+
</CleanUiProvider>
|
|
102
|
+
);
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
See the [Quick Start docs](https://shadercloud.github.io/rbxts-react-clean-ui/quickstart) for the full walkthrough (including `default.project.json` setup), and the [`Stories`](./Stories) directory for live UI Labs examples you can open directly in Roblox Studio.
|
|
106
|
+
|
|
107
|
+
## Project status
|
|
108
|
+
|
|
109
|
+
React Clean UI is under active development and being built in public. APIs, component props, and installation details may still change before a first stable release. Feedback, issues, and contributions are welcome.
|
|
110
|
+
|
|
111
|
+
## License
|
|
112
|
+
|
|
113
|
+
[ISC](./LICENSE)
|
|
@@ -20,6 +20,7 @@ export interface ButtonTextProps extends ScalableElementProps, IntentElementProp
|
|
|
20
20
|
text: string;
|
|
21
21
|
disabled?: boolean;
|
|
22
22
|
styleOverride?: ButtonStyleOverride;
|
|
23
|
+
LayoutOrder?: number;
|
|
23
24
|
}
|
|
24
25
|
declare function ButtonText(props: ButtonTextProps): React.JSX.Element;
|
|
25
26
|
export interface ButtonIconProps extends IconProps, IntentElementProps {
|
|
@@ -71,6 +71,7 @@ local function ButtonText(props)
|
|
|
71
71
|
end
|
|
72
72
|
end
|
|
73
73
|
_attributes.typography = TypographyHelper:getTypography(theme, _exp, _object)
|
|
74
|
+
_attributes.LayoutOrder = props.LayoutOrder
|
|
74
75
|
local _exp_1 = props.intent
|
|
75
76
|
local _exp_2 = if props.disabled then "disabled" else "default"
|
|
76
77
|
local _exp_3 = theme.components.button.intents
|
|
@@ -284,6 +285,7 @@ local Button = React.forwardRef(function(props, ref)
|
|
|
284
285
|
spacing = props.spacing,
|
|
285
286
|
Wraps = false,
|
|
286
287
|
}, props.icon ~= nil and React.createElement(ButtonIcon, {
|
|
288
|
+
LayoutOrder = 1,
|
|
287
289
|
scale = props.scale,
|
|
288
290
|
intent = props.intent,
|
|
289
291
|
disabled = props.disabled,
|
|
@@ -291,6 +293,7 @@ local Button = React.forwardRef(function(props, ref)
|
|
|
291
293
|
spinning = props.spinning,
|
|
292
294
|
styleOverride = props.styleOverride,
|
|
293
295
|
}), props.text ~= nil and React.createElement(ButtonText, {
|
|
296
|
+
LayoutOrder = 2,
|
|
294
297
|
text = props.text,
|
|
295
298
|
intent = props.intent,
|
|
296
299
|
disabled = props.disabled,
|