Portable UI
useSlotFill
v1.0.0Hook to register a slot fill from a module component. Automatically registers on mount and removes on unmount.
Import
import { useSlotFill } from '@meteorack/modules-sdk-ui/slots';How To Use It
- Call in a component to contribute UI to a named slot. The component renders nothing — SlotHost handles rendering.
Works Well With
Methods
fill: ResolvedSlotFillThe slot fill to register (slotName, moduleSlug, component, priority).
Example
bootstrap.php
import { useSlotFill } from '@meteorack/modules-sdk-ui/slots';
function MyModuleWidget() {
useSlotFill({
slotName: 'dashboard-widgets',
moduleSlug: 'my-module',
component: WidgetComponent,
priority: 10,
});
return null;
}