Hi,
I’d like to request a loading property for s-admin-block, similar to the one available on s-admin-action.
Use case and current issue
A block on an order details page may need to fetch data from the Admin API or the app’s backend before displaying its content. A similar situation occurs when refreshing data after a user performs an action.
Currently, we can add our own spinner inside the component and display it while fetching data. However, there is a break in the loading experience: Shopify’s default loading indicator appears first, then it is replaced by the custom spinner rendered inside our component.
As a result, the user sees a visual jump between two loading indicators, even though, from their perspective, the same loading process is still underway. The actual block content only appears afterward.
Proposed solution
A loading property of type boolean, defaulting to false, would allow extensions to control the block’s native loading state.
The main goal is to keep Shopify’s default loading indicator visible until the extension has finished fetching its data and is ready to display its content. The expected result is a single, continuous loading state followed by the actual content, without switching to a custom spinner in between.
Similar to s-admin-action, setting loading={true} could also temporarily prevent interaction with the block’s content.
Example usage if this feature were added:
<s-admin-block heading="Order details" loading={isLoading}>
{/* Block content */}
</s-admin-block>
This would make the loading experience smoother, provide consistent loading behavior across Admin UI Extensions, and reduce the need to implement custom loading indicators in each block.
Thanks!