Skip to content

(Component):new<Type>

Used to create a new Component, and return that new component.

Synopsis

newComponent = parentComponent:new<Type>(component)

Parameters

Type string
This is the component type that you want to create.
component Component
The initial values for the component, such as id.

Returns

newComponent Component
The newly created component.

Examples

local card = tab:newCard()

local list = card:newList({ id = "myList", isNumbered = true })

list:newContainer()
  :newText({ text = "Hello world" })
    .back
  :newText({ text = "Example" })

See Also