IfInMiniApp
component provides conditional rendering based on whether the app is running inside a Farcaster Mini App. It renders children only when inside a Mini App, and optionally shows a fallback when outside.
Usage
Basic conditional rendering
Show different content based on Mini App context:With fallback content
Show alternative content when not in a Mini App:Advanced Usage
Mini App-specific navigation
Feature-specific UI
Layout adaptation
Requirements
TheIfInMiniApp
component requires:
-
MiniKit enabled in
OnchainKitProvider
: - Running inside a Farcaster Mini App context
Behavior
- Inside Mini App + MiniKit enabled: Renders
children
- Outside Mini App OR MiniKit disabled: Renders
fallback
ornull
- No fallback provided: Renders
null
when conditions arenβt met
Props
IfInMiniAppProps