Skip to content

Commit dffd851

Browse files
authored
Added documentation for uiShown callback. (#90)
1 parent 83a1bde commit dffd851

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,10 +396,7 @@ popup is blocked by the browser, it will fall back to a full page redirect.
396396

397397
### Available callbacks
398398

399-
Currently only one callback is supported. Some will be added soon to monitor UI
400-
changes.
401-
402-
`signInSuccess(currentUser, credential, redirectUrl)`
399+
#### `signInSuccess(currentUser, credential, redirectUrl)`
403400

404401
**Parameters:**
405402

@@ -423,6 +420,12 @@ static `signInSuccessUrl` in config.
423420
If the callback returns `false` or nothing, the page is not automatically
424421
redirected.
425422

423+
#### `uiShown()`
424+
425+
This callback is triggered the first time the widget UI is rendered. This is
426+
useful for cases where the application should display a custom loader before
427+
FirebaseUI is displayed.
428+
426429
### Example with all parameters used
427430

428431
```html
@@ -446,6 +449,11 @@ redirected.
446449
// Return type determines whether we continue the redirect automatically
447450
// or whether we leave that to developer to handle.
448451
return true;
452+
},
453+
uiShown: function() {
454+
// The widget is rendered.
455+
// Hide the loader.
456+
document.getElementById('loader').style.display = 'none';
449457
}
450458
},
451459
credentialHelper: firebaseui.auth.CredentialHelper.ACCOUNT_CHOOSER_COM,
@@ -477,6 +485,7 @@ redirected.
477485
Your app may use that space for branding, controls and other customizations.-->
478486
<h1>Welcome to My Awesome App</h1>
479487
<div id="firebaseui-auth-container"></div>
488+
<div id="loader">Loading...</div>
480489
</body>
481490
</html>
482491
```

0 commit comments

Comments
 (0)