Configuration

You can modify the default behavior of the Toolkit by overriding the configuration object:

Note: The initial Sidebar configuration is overridden by user preferences.

/MyPlugin/reactium-hooks.js
import Reactium from 'reactium-core/sdk'; 

Reactium.Plugin.register('MyPlugin').then(() => {
    // Ensure the toolkit plugin is available
    if (!Reactium.Toolkit) return;
    
    // Override sidebar width
    Reactium.Toolkit.setConfig('sidebar.width', 480);
});

The Toolkit SDK exposes a read-only property for the configuration object:

Reactium.Toolkit.config
import React from 'react'; 
import Reactium from 'reactium-core/sdk';

const MyComponent = () => {
    const config = Reactium.Toolkit.config; 
    
    console.log(config); 
    
    return <div>My Plugin</div>;
};

Last updated