mui / mui/material-ui

[Skeleton] Add loading property

Open
#30,407 6 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

scope: skeleton type: new feature waiting for 👍
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

Duplicates
  • I have searched the existing issues
Latest version
  • I have tested the latest version
Summary 💡

Add the loading property to simplify the loading branch of the data acquisition.

Examples 🌈

Use cases are expected to include

<Skeleton loading={loading}>
	<Children />
</Skeleton>
Motivation 🔦

I would like to achieve the following simplification of branching.

current

{loading ? (
  <Skeleton variant="circular">
    <Avatar />
  </Skeleton>
) : (
  <Avatar src={data.avatar} />
)}

After the realization of this ISSUE

<Skeleton loading={loading} variant="circular">
  <Avatar src={data.avatar} />
</Skeleton>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Skeleton component entry point and read how it currently renders its children and variants. Add the loading behavior described in the examples so consumers can wrap content with Skeleton loading={loading}; done means the loading branch is handled by Skeleton while the loaded child renders normally.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.