Skip to content

Switch component: Recommended loading state? #3851

Answered by TheSisb
waijeeho asked this question in Q&A
Discussion options

You must be logged in to vote

Optimistic rendering is a technique in UI design where, upon user action, the interface assumes success without waiting for confirmation from the server. It immediately displays the expected outcome, providing users with instant feedback. If the server confirms success, all remains as expected; if not, the UI updates accordingly.

In your case, the toggle just flips over with no extra treatment. If the server replies success, do nothing. If the server replies an error, undo the toggle and - for example - display an error toast.

Replies: 1 comment 11 replies

Comment options

You must be logged in to vote
11 replies
@waijeeho
Comment options

@TheSisb
Comment options

@waijeeho
Comment options

@TheSisb
Comment options

Answer selected by serifluous
@roxanagomez
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants