@@ -6,6 +6,7 @@ Sequence Web SDK 🧰 is a library enabling developers to easily integrate web3
66- Connect to popular web3 wallets eg: walletConnect, metamask ! 🦊 ⛓️
77- Full-fledged embedded wallet for coins and collectibles 👛 🖼️ 🪙
88- Fiat onramp 💵 💶 💴 💷
9+ - Inline connect UI for custom layouts and embedded experiences 🎨
910
1011View the [ demo] ( https://0xsequence.github.io/web-sdk ) ! 👀
1112
@@ -52,6 +53,7 @@ interface CreateConfigOptions {
5253 chainId: number
5354 }>
5455 ethAuth? : EthAuthSettings
56+ onConnectSuccess? : (address : string ) => void // callback fired when wallet connects
5557
5658 wagmiConfig? : WagmiConfig // optional wagmiConfig overrides
5759
@@ -243,6 +245,76 @@ const MyReactComponent = () => {
243245}
244246```
245247
248+ ### Inline Connect UI
249+
250+ <div align =" center " >
251+ <img src =" public/docs/inline-connect.png " alt =" Inline Connect UI " >
252+ </div >
253+
254+ Instead of using a modal, you can render the connect UI inline within your layout using the ` SequenceConnectInline ` component. This is perfect for custom layouts, embedded wallet experiences, or when you want the connect UI to be part of your page flow.
255+
256+ ``` js
257+ import { SequenceConnectInline , createConfig } from ' @0xsequence/connect'
258+ import { useNavigate } from ' react-router-dom'
259+
260+ const config = createConfig (' waas' , {
261+ projectAccessKey: ' <your-project-access-key>' ,
262+ chainIds: [1 , 137 ],
263+ defaultChainId: 1 ,
264+ appName: ' Demo Dapp' ,
265+ waasConfigKey: ' <your-waas-config-key>' ,
266+
267+ // Optional: callback fired when wallet connects successfully
268+ onConnectSuccess : (address ) => {
269+ console .log (' Connected wallet:' , address)
270+ // Redirect or perform other actions
271+ },
272+
273+ google: { clientId: ' <your-google-client-id>' },
274+ email: true
275+ })
276+
277+ function InlinePage () {
278+ return (
279+ < div className= " my-custom-layout" >
280+ < h1> Connect Your Wallet< / h1>
281+ < SequenceConnectInline config= {config} / >
282+ < / div>
283+ )
284+ }
285+ ```
286+
287+ #### Key Differences from Modal UI:
288+
289+ - ** No padding/margins** : The inline UI removes the default padding designed for modal display
290+ - ** Full width** : The component fills its container width
291+ - ** No modal backdrop** : Renders directly in your layout
292+ - ** Custom positioning** : You control the placement with your own CSS/layout
293+
294+ #### Advanced: Using SequenceConnectInlineProvider
295+
296+ For more control, you can use the lower-level ` SequenceConnectInlineProvider ` :
297+
298+ ``` js
299+ import { SequenceConnectInlineProvider } from ' @0xsequence/connect'
300+ import { WagmiProvider } from ' wagmi'
301+ import { QueryClient , QueryClientProvider } from ' @tanstack/react-query'
302+
303+ const queryClient = new QueryClient ()
304+
305+ function App () {
306+ return (
307+ < WagmiProvider config= {wagmiConfig}>
308+ < QueryClientProvider client= {queryClient}>
309+ < SequenceConnectInlineProvider config= {connectConfig}>
310+ < YourContent / >
311+ < / SequenceConnectInlineProvider>
312+ < / QueryClientProvider>
313+ < / WagmiProvider>
314+ )
315+ }
316+ ```
317+
246318## Hooks
247319
248320### useOpenConnectModal
@@ -294,6 +366,11 @@ The settings are described in more detailed in the Sequence Web SDK documentatio
294366 }
295367 ],
296368 readOnlyNetworks: [10 ],
369+ // callback fired when wallet connects successfully
370+ onConnectSuccess : (address ) => {
371+ console .log (' Wallet connected:' , address)
372+ // Perform actions like redirecting, analytics tracking, etc.
373+ },
297374 }
298375
299376 < SequenceConnectProvider config= {connectConfig}>
0 commit comments