@bezysoftware/firebase-ui-react
v7.0.0
Published
This package contains the React components for the FirebaseUI.
Readme
@bezysoftware/firebase-ui-react
This package contains the React components for the FirebaseUI.
Installation
Install the package from NPM:
npm install @bezysoftware/firebase-ui-react@betaUsage
Importing styles
To use the components, you need to import the styles from the @bezysoftware/firebase-ui-styles package.
If using Tailwind CSS, you can import the styles directly into your project.
@import "tailwindcss";
@import "@bezysoftware/firebase-ui-styles/src/base.css";Alternatively, you can import the fully compiled CSS file into your project.
import "@bezysoftware/firebase-ui-styles/dist.css";Initializing the UI
First, initalize the Firebase JS SDK:
import { initializeApp } from "firebase/app";
const app = initializeApp({ ... });Then, initialize the FirebaseUI with the configuration:
import { initializeUI } from "@bezysoftware/firebase-ui-react";
const ui = initializeUI({
app,
});Finally, wrap your app in the ConfigProvider component:
import { ConfigProvider } from "@bezysoftware/firebase-ui-react";
createRoot(document.getElementById("root")!).render(
<StrictMode>
<ConfigProvider config={ui}>
<App />
</ConfigProvider>
</StrictMode>
);Importing components
To use the components, you need to import the components from the @bezysoftware/firebase-ui-react package.
import { SignInAuthScreen, GoogleSignInButton } from "@bezysoftware/firebase-ui-react";
function App() {
return (
<SignInAuthScreen>
<GoogleSignInButton />
</SignInAuthScreen>
);
}