Choose Your UI Mode
Use this page when you are deciding whether MediaSFU should render the visible room UI or only provide the live runtime behind your app shell.
The short answer
| If you need... | Start with |
|---|---|
| The fastest path with MediaSFU still rendering the visible room experience | returnUI={true} |
| Full ownership of the visible product shell from first paint | returnUI={false} |
| A custom workspace but still within MediaSFU's visible room runtime | returnUI={true} plus customComponent |
| Mostly stock workflow with selected cards, modals, or menus restyled | returnUI={true} plus uiOverrides |
What returnUI actually changes
returnUI={true}
MediaSFU mounts a visible UI layer.
- keep the stock room flow and restyle pieces of it
- override cards, menus, modals, or helper surfaces
- replace the main workspace with
customComponentwhile MediaSFU still owns the visible room runtime
returnUI={false}
MediaSFU runs headless.
- your app renders the visible shell
- MediaSFU exposes the live helper bundle through
sourceParametersandupdateSourceParameters - your own components call helpers such as
clickAudio,clickVideo,clickScreenShare, andlaunchRecording
The three common patterns
1. Override-first
Use this when the room still looks like MediaSFU, but branded.
<MediasfuGeneric
connectMediaSFU={true}
returnUI={true}
customVideoCard={CompactVideoCard}
customMiniCard={CompactMiniCard}
uiOverrides={uiOverrides}
/>
Best fit:
- compact call products
- branded cards and control bars
- teams optimizing for fastest time to demo
2. Custom workspace with MediaSFU still visible
Use this when the visible product is yours, but MediaSFU can still own the room-shaped runtime around it.
<MediasfuGeneric
connectMediaSFU={true}
returnUI={true}
customComponent={HostDashboard}
/>
Best fit:
- host dashboards
- guest queues
- products that still benefit from MediaSFU's visible runtime contract
3. Full headless shell
Use this when the visible product must be fully app-owned.
<>
<MediasfuGeneric
connectMediaSFU={true}
returnUI={false}
sourceParameters={sourceParameters}
updateSourceParameters={setSourceParameters}
/>
<OperatorConsole parameters={sourceParameters} />
</>
Best fit:
- support or CRM consoles
- non-room workflows
- products with app-owned navigation, tabs, or shell framing from first paint
How to choose between true and false
- If you want MediaSFU's visible room flow to stay on screen, start with
returnUI={true}. - If you only need branding or targeted surface changes, stay with
returnUI={true}and use overrides first. - If you need a custom dashboard but can still live inside MediaSFU's visible room runtime, use
returnUI={true}pluscustomComponent. - If your product needs app-owned navigation, sidebars, pane layouts, or a non-room shell from first paint, move to
returnUI={false}. - If you expect most user actions to originate from your own workspace instead of MediaSFU surfaces, the headless path is usually cleaner.
How the current starters map to this choice
| Starter | Default angle | Alternate angle |
|---|---|---|
| Tutorial - WhatsApp-style call screen | returnUI={true} plus light overrides | returnUI={false} plus a compact call shell driven by sourceParameters |
| Tutorial - Twitch-style host dashboard | returnUI={true} plus customComponent | returnUI={false} plus a headless host dashboard |
| Tutorial - TikTok Live guest queue | returnUI={true} plus customComponent | returnUI={false} plus a headless queue shell |
| Tutorial - Support or AI agent console | returnUI={false} plus a headless console | returnUI={true} only when the operator workspace can stay room-shaped |