In an app I'm building the user can click a button to load more content, which might take 1 second or up to X seconds (when X seconds passed I show a timeout error message). There is a "Loading" text (at the moment, it might end up being a spinner) that appears once the button is clicked and disappears when the content is loaded.
My idea is to show the loading state as soon as the user clicks. If the content arrives "too fast" the loading will appear for a very short time, so the user will know something was shown but won't be able to realize what it was (and look strange).
On one hand the content should arrive as soon as possible, but on the other hand, it might be strange to show some information without a minimum time (2 seconds maybe?) to assimilate it.
Any ideas of what is the correct way to go?
I am not looking for specific solutions on how to implement a loading state, @Majo0od provided a very useful link in the comments. I am looking for rationale and/or any relevant case or information if there is.
looks strangepart will rarely, if ever, be an issue. Good luck!
div. It would never hinder the user's flow if the loader is either placed like in stackexchange's editor (right next to submit button) or top of the