Skip to content

Slots Guide ​

This repo uses slot overrides to customize UI per instance without forking core UI.

Add a New Slot ​

  1. Define the slot type in packages/core-ui-slots/src/index.ts:
ts
'Core.AppContainer.Topbar.SignOutButton': {
  onClick?: () => void | Promise<void>;
};
  1. Render the slot in the core component using SlotRenderer:
tsx
<SlotRenderer
  name="Core.AppContainer.Topbar.SignOutButton"
  slotProps={{ onClick: logOut }}
>
  {({ onClick }) => (
    <Button onClick={() => (onClick ? onClick() : logOut())}>Sign Out</Button>
  )}
</SlotRenderer>
  1. Override the slot in an instance (e.g., PPP) via useInitSlots:
ts
useInitSlots({
  slots: {
    'Core.AppContainer.Topbar.SignOutButton': MySignOutButton,
  },
  slotProps: {
    'Core.AppContainer.Topbar.SignOutButton': {
      onClick: mySignOutHandler,
    },
  },
});

Notes ​

  • Keep default behavior in core components so other instances remain unaffected.
  • Only add slot props that are required for overrides.
  • Prefer stable slot names to avoid breaking instances.

Internal documentation — org members only