🚀
Maclib UI Library
  • Information
    • Welcome
    • Documentation Formatting
    • Miscellaneous
  • Getting Started
    • Loading Maclib
      • Creating a window
        • Adding a Global Setting
        • Displaying a notification
        • Prompting a dialog
        • Creating a tab group
          • Adding tabs
            • Adding sections
              • Button
              • Input
              • Slider
              • Toggle
              • Keybind
              • Colorpicker
              • Dropdown
              • Header
              • Paragraph
              • Label
              • Sub Label
              • Divider
              • Spacer
Powered by GitBook
On this page

Was this helpful?

  1. Information

Documentation Formatting


Each argument is listed with its name followed by its type in angle brackets (<>), indicating the kind of data it expects.

Example:

Title <string>

Use case example:

Title = "Kuzu Hub"

A ... before a <table> type means the function can take multiple arguments in a variable-length table.

Example:

Tree <...table: FruitName, FruitColor> -- Accepts multiple Fruit definitions, each as a table with a Name and Color.

Use case example:

Tree = {
    {
        FruitName = "Apple"
        FruitColor = Color3.fromRGB(255,0,0)
    },
    {
        FruitName = "Orange"
        FruitColor = Color3.fromRGB(255,165,0)
    }
}

A colon (:) inside a type means those are the arguments that the type expects.

Example:

PrintWhat <string: "Hello, World!", "Goodbye, world."> -- Expects one of the two strings.

Use case example:

PrintWhat = "Hello, World!" -- Is expected (Accepted)
--
PrintWhat = "Goodbye, world." -- Is expected (Accepted)
--
PrintWhat = "Lorem Ipsum" -- Not expected (Rejected)

A (): after a function type indicates the return type.

Example:

Callback <function(): string> -- The function returns a string when called.

Use case example:

Callback = function(Input)
    print(Input)
end)

A (): void after a function type indicates it does not return anything.

Example:

Callback <function(): void> -- The function returns nothing when called.

Use case example:

Callback = function()
    print("Hello, World!")
end)

<type or type> means the argument can accept either type.

Example:

Default <number or table> -- Accepts either a number or a table as the default value.

Use case example:

Default = 5 -- Accepted
--
Default = {"Hello", "World"} -- Accepted
--
Default = true -- Rejected (not a number or table)

A : followed by a type indicates a return value and its type.

Example:

:GetFruitSize(<string>: number) -- Returns the size of the specified fruit.
:GetState(: boolean) -- Returns whether the window is currently visible or not.

Use case example:

:GetFruitSize("Apple") -- Returns the size as a number of an apple
--
:GetState() -- Returns the state as a boolean

PreviousWelcomeNextMiscellaneous

Last updated 9 months ago

Was this helpful?