mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
93.89k stars 32.26k forks source link

[joy-ui] Add Spin component #41351

Open mohammad19974 opened 8 months ago

mohammad19974 commented 8 months ago

Summary

A spinner for displaying loading state of a page or a section or a suspense.

When To Use When a portion of the page is awaiting asynchronous data or undergoing a rendering process, incorporating a well-designed loading animation can significantly ease user anticipation and enhance their experience.

Examples

data

Motivation

No response

Search keywords: Loading

zprobinson commented 8 months ago

What does the suggested spin component provide over than the circular progress component, linear progress component, or skeleton loader component?

yasminebeji commented 8 months ago

@mohammad19974 Could you share instances or scenarios in which you see the Spin component being more beneficial than existing loading components such as Circular Progress or Linear Progress?

siriwatknp commented 8 months ago

I agree with @zprobinson and @yasminebeji. Please share more details about the use cases and examples (maybe screenshots, recording or mockup).

mohammad19974 commented 8 months ago

` <Spin spinning={true} indicator={< Circular/>}>

Hello
 <div>Content here</div>
  </Spin>

`

Screenshot 2024-03-06 at 20 15 28

the spin :loading (with backdrop or not ) wrapper on content

zprobinson commented 8 months ago

This seems like something that the components exposed in mui joy already can be used to create, with not too much difficulty.

Where is the threshold between what the library exports and what consumers of the library can create as a reusable app component?

siriwatknp commented 8 months ago

<Spin spinning={true} indicator={< Circular/>}> <div>Hello</div> <div>Content here</div> </Spin>

Thanks for the clarity. It looks like an Overlay with loading component.

Where is the threshold between what the library exports and what consumers of the library can create as a reusable app component?

It's hard to justify but most of the time we prioritize component based on issues upvotes.