Loading option

This sample shows how you can display a loading message while waiting for an Option<T> to be loaded into a Blazor component.

Note that as the data being passed to the <BusyOption> component is nullable (it's declared as Option<Customer>?), this allows the component to show a "Loading..." message before the data has been set. Click a button to "load" the data, or refresh the page to see what it looks like while still loading.

The "Loading" content has only basic styling, leaving you free to add your own styles.

Click one of the buttons below to load existing customer details, or see what happens when the customer cannot be found...

Customer details

Loading...

An error has occurred. This application may no longer respond until reloaded. Reload 🗙