Skip to content

Ui ​

The global Ui.

Functions ​

  • Ui.new(className: string, props: {[any]: any}?): Instance
  • Ui.View(props: {[any]: any}?): View
  • Ui.ScrollView(props: {[any]: any}?): ScrollView
  • Ui.Text(props: {[any]: any}?): Text
  • Ui.TextInput(props: {[any]: any}?): TextInput
  • Ui.Terminal(props: {[any]: any}?): Terminal
  • Ui.Image(props: {[any]: any}?): Image
  • Ui.Surface(props: {[any]: any}?): Surface
  • Ui.Shortcut(props: {[any]: any}?): Shortcut
  • Ui.State<T>(value: T): UiState<T>
  • Ui.Computed<T>(compute: (use: (source: any) -> any) -> T): UiState<T>
  • Ui.ForEach<T>(list: UiState<{T}> | {T}, render: (item: T, index: number) -> Instance, key: (string | (item: T) -> any)?): UiState<{Instance}>
  • Ui.Animated<T>(source: UiState<T>, info: TweenInfo?): UiState<T>
  • Ui.Spring<T>(source: UiState<T>, speed: number?, damping: number?): UiState<T>
  • Ui.Markup(spans: {any}): string
  • Ui.StyleSheet(rules: {[string]: {[string]: any}} | string | UiState<string> | UiState<{[string]: {[string]: any}}>): StyleSheet
  • Ui.LoadStyleSheet(path: string): StyleSheet
  • Ui.LoadFont(family: string, path: string, weight: number?): ()

Types ​

luau
export type UiConnection = {
	Connected: boolean,
	Disconnect: (self: UiConnection) -> (),
}

export type UiChanged<T> = {
	Connect: (self: UiChanged<T>, callback: (T) -> ()) -> UiConnection,
}

export type UiState<T> = {
	Get: (self: UiState<T>) -> T,
	Set: (self: UiState<T>, value: T) -> (),
	Destroy: (self: UiState<T>) -> (),
	Changed: UiChanged<T>,
}

Apache License 2.0