Skip to main content

PluginProvider

This component provides an interface to plugin apis for other components in the tree. It should be provided with a single Plugin prop that must point to plugin (your plugin's root instance).

You do not have to use this component unless you want custom mouse icons via the useMouseIcon hook. Right now, the only built-in component that relies on this is Splitter. Theming and all other functionality will work regardless of whether this component is used.

You should only render one PluginProvider in your tree. Commonly, this is done at the top of the tree with the rest of your plugin as children/descendants.

Example of usage:

local function MyComponent()
	return React.createElement(StudioComponents.PluginProvider, {
		Plugin = plugin,
	}, {
		MyExample = React.createElement(MyExample, ...)
	})
end

Types

Props

Component Props
interface Props {
PluginPlugin
childrenReact.ReactNode
}
Show raw api
{
    "functions": [],
    "properties": [],
    "types": [
        {
            "name": "Props",
            "desc": "",
            "fields": [
                {
                    "name": "Plugin",
                    "lua_type": "Plugin",
                    "desc": ""
                },
                {
                    "name": "children",
                    "lua_type": "React.ReactNode",
                    "desc": ""
                }
            ],
            "tags": [
                "Component Props"
            ],
            "source": {
                "line": 46,
                "path": "src/Components/PluginProvider.luau"
            }
        }
    ],
    "name": "PluginProvider",
    "desc": "This component provides an interface to plugin apis for other components in the tree. It should\nbe provided with a single `Plugin` prop that must point to `plugin` (your plugin's root instance).\n\nYou do not have to use this component unless you want custom mouse icons via the [useMouseIcon] \nhook. Right now, the only built-in component that relies on this is [Splitter]. Theming and all\nother functionality will work regardless of whether this component is used.\n\nYou should only render one PluginProvider in your tree. Commonly, this is done at the top of\nthe tree with the rest of your plugin as children/descendants.\n\nExample of usage:\n\n```lua\nlocal function MyComponent()\n\treturn React.createElement(StudioComponents.PluginProvider, {\n\t\tPlugin = plugin,\n\t}, {\n\t\tMyExample = React.createElement(MyExample, ...)\n\t})\nend\n```",
    "source": {
        "line": 26,
        "path": "src/Components/PluginProvider.luau"
    }
}