Skip to main content

Util

Important utilities for UI development.

Properties

Colors

This item is read only and cannot be modified. Read Only
Util.Colors: table

Colors imported from TailwindCSS's color palette.

Functions

Fallback

Util.Fallback(
ValueFusion.UsedAs<any>,
Fallbackany
) → any

Defaults the given Value to Fallback if nil.

CombineProps

Util.CombineProps(
SourceFusion.PropertyTable,
TargetFusion.PropertyTable,
ExcludedKeys{any}?
) → Fusion.PropertyTable

Combines two sets of props for easy passthrough, adding Source's props to Target. If a prop is already in Target, it will be overridden.

EnsureValue

Util.EnsureValue(
ScopeFusion.Scope<any>,
ValueFusion.UsedAs<any>
) → Fusion.Value<Fusion.Scope<any>,any>

Converts the Value argument to a Fusion.Value object, if it is not one already.

Show raw api
{
    "functions": [
        {
            "name": "Fallback",
            "desc": "Defaults the given `Value` to `Fallback` if nil.",
            "params": [
                {
                    "name": "Value",
                    "desc": "",
                    "lua_type": "Fusion.UsedAs<any>"
                },
                {
                    "name": "Fallback",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 11,
                "path": "src/Util/Fallback.luau"
            }
        },
        {
            "name": "CombineProps",
            "desc": "Combines two sets of props for easy passthrough, adding `Source`'s props to `Target`. If a prop is already in `Target`, it will be overridden.",
            "params": [
                {
                    "name": "Source",
                    "desc": "",
                    "lua_type": "Fusion.PropertyTable"
                },
                {
                    "name": "Target",
                    "desc": "",
                    "lua_type": "Fusion.PropertyTable"
                },
                {
                    "name": "ExcludedKeys",
                    "desc": "",
                    "lua_type": "{ any }?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Fusion.PropertyTable"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 12,
                "path": "src/Util/CombineProps.luau"
            }
        },
        {
            "name": "EnsureValue",
            "desc": "Converts the `Value` argument to a `Fusion.Value` object, if it is not one already.",
            "params": [
                {
                    "name": "Scope",
                    "desc": "",
                    "lua_type": "Fusion.Scope<any>"
                },
                {
                    "name": "Value",
                    "desc": "",
                    "lua_type": "Fusion.UsedAs<any>"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Fusion.Value<Fusion.Scope<any>, any>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 11,
                "path": "src/Util/EnsureValue.luau"
            }
        }
    ],
    "properties": [
        {
            "name": "Colors",
            "desc": "Colors imported from [TailwindCSS's color palette](https://tailwindcss.com/docs/customizing-colors#default-color-palette).",
            "lua_type": "table",
            "readonly": true,
            "source": {
                "line": 8,
                "path": "src/Util/Colors.luau"
            }
        }
    ],
    "types": [],
    "name": "Util",
    "desc": "Important utilities for UI development.",
    "source": {
        "line": 6,
        "path": "src/Util/init.luau"
    }
}