Start app with login screen automatically open

I remember there used to be a way to use a css class to automatically open the login screen modal.
I don’t see that mentioned anywhere in the docs, and I don’t see any information either as to how this can be done.

Is this still an option, and if so what is the class name and where does it go?

You can add class modal-in, but better just open login screen right after you init it, e.g.:

const loginScreen = f7.loginScreen.create(...);
loginScreen.open(false); // `false` here means without animation, immediately
1 Like

Excellent, thank you. Both of those options work.
Is there a reason you prefer the javascript solution as opposed to the css solution?
I would think the css solution would be faster in rendering…

I would suggest to try JS solution first, it is a more proper way. If it won’t work or you see some flashes, then go with css class

1 Like