Native UI
Show native banners, alerts, popups, menus, pickers, and control the status bar and orientation from your web code.
Set up
Use bdk.ui to drive native surfaces from your web code. Calls that return a value (menu taps, popup buttons, picks) deliver it on an event — subscribe with bdk.on(...) before you call.
Outside the app these calls don't run (triggered: false) and no native surface appears. Provide a web fallback for anything the user must respond to.
Show an alert
Show a blocking system alert the user must acknowledge before continuing.
Ask the user to confirm
Show a popup with action buttons. Pass ok_label and cancel_label to set the button labels. The pressed button arrives on the popupClosed event — subscribe first.
The popupClosed payload tells you which button dismissed the popup — the OK or Cancel button.
Prompt for an app-store rating
Show the OS rating prompt at a natural moment.
Pick a date or time
Open a native date/time picker. Subscribe to datePicked before you call — it still fires on every build.
On current app builds the awaited call also resolves the result directly ({ ok: true, value, epochMs }) and datePicked delivers the epoch milliseconds. On older builds the result arrives only on datePicked.
Style the status bar
Set the status-bar color. Android paints the bar with the color you pass; iOS keeps the system background and picks the readable content style for it.
Control screen orientation
Set or lock the screen orientation. lockOrientation() locks the current orientation; pass { locked: false } to unlock.
Android only — wrap the call in try/catch.
Disable the iOS back-swipe
Suppress the iOS left-edge back-swipe when a screen owns that gesture itself. disableLeftSwipe() disables it; pass { enabled: true } to re-enable.
iOS only — wrap the call in try/catch.
Event reference
Register handlers with bdk.on(event, listener), which returns an unsubscribe function.
menuClicked— the menu item the user tapped (its title and data).popupClosed— which button dismissed the popup.datePicked— the date/time the user selected.
A throwing listener surfaces once as a BdkError with code BDK_LISTENER_ERROR, via both the onError config callback and the error event.