I want to add a container around my Descope-genera...
# ask-a-descoper
n
I want to add a container around my Descope-generated login window. This is the code that I'm using and it doesn't work. Do you have any idea how to make it work? <div className="container"> <Descope flowId="sign-in" onSuccess = {(e) => { console.log(e.detail.user.name) console.log(e.detail.user.email) }} onError={(e) => console.log('Could not log in!')} /> </div>
g
Hi, need to set style on the
container
class
n
Sure, that was the style that I added: .container { border-radius: 10px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); padding: 20px; background-color: #FFFFFF; max-width: 500px; /* Set a maximum width for the container */ margin: 0 auto; /* Center the container horizontally */ }
g
see for example how the react-sdk sample app limits the container width https://github.com/descope/react-sdk/blob/main/examples/app/App.tsx#L10
n
Thanks. Looks very cumbersome. Isnt it possible to do it with wrapping the Descope login form with a <div className="container"> ?
g
it is possible, and should work, need to debug the sizes in the browser dev tools to see why the style is not apply try to check in the CSS definitions
n
Do you have any example where it does work?
n
Fixed. thanks!
👋 1