-
Notifications
You must be signed in to change notification settings - Fork 0
Components
In OSUI's definition. A component is a Structure that is meant to render on the screen. OSUI components work similarly to React or HTML components. But not exactly
Each component has it's own use case and how-to. But simply call a function and send it to other components or the screen
func main() {
app := ui.Div( // Div component
ui.Text("Hello, World!") // Text component
)
screen := osui.NewScreen(app)
screen.Run()
}Most components have a .Param() function, This functions is for changing the params of a function. Each function has it's own Paramters with the name <component-name>Params
A Div is a component that handles multiple components at once
ui.Div(components...)ui.Div(ui.Text("Hello, World!"))A Button can be clicked with the enter key while it's selected
ui.Button(text)ui.Button("Click me!")A InputBox takes user input from the user
ui.InputBox(max_size)ui.InputBox(20)A Menu prompts the user to select a list of items
ui.Menu(items...)ui.Menu("Item 1", "Item 2", "Item 3", "Item 4", "Item 5")A Paginator. Like a div. Puts multiple components into one single component In a tab style
ui.Paginator(components...)ui.Paginator(ui.Text("Hello, World!"))A Text. Renders text.. That's it
ui.Text(text)ui.Text("Hello, World!")