-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: adding skeleton component #13780
base: main
Are you sure you want to change the base?
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
4230250
to
fce3ee1
Compare
fce3ee1
to
548b20c
Compare
|
@@ -0,0 +1,105 @@ | |||
# Skeleton | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't have an image to put here because there is no Skeleton in Figma
<View style={styles.base} {...props}> | ||
{/* Animated background always present */} | ||
<Animated.View | ||
style={[styles.background, { opacity: opacityAnim }]} | ||
pointerEvents="none" | ||
{...animatedViewProps} | ||
/> | ||
|
||
{children && ( | ||
<View | ||
style={[ | ||
styles.childrenContainer, | ||
hideChildren ? styles.hideChildren : undefined, | ||
]} | ||
{...childrenWrapperProps} | ||
> | ||
{children} | ||
</View> | ||
)} | ||
</View> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few nuances here that I'll touch on.
We want children to be both viewable and hideable within the skeleton so we can pass in skeleton loaders to create more complex loading states. See the WithChildren
story:

We also want children to be hideable so we can pass in the same content as what is being loaded, allowing the skeleton to resize to fit the children within it. Additional styles might be needed for this—see the HideChildren
story:


7223d3d
to
2bca572
Compare
Description
This PR introduces a new Skeleton component to MetaMask Mobile, mirroring the functionality of the Skeleton component in MetaMask Extension. The Skeleton component serves as a placeholder UI element displayed while content is loading.
The reason for this change is to provide a consistent loading UI experience across the application, and to support snaps and the multichain efforts by matching what's available in the extension codebase. The solution includes an animated placeholder component that can adapt to different content layouts, providing visual feedback during loading states.
Key features include:
Related issues
Fixes: #3324
Manual testing steps
Screenshots/Recordings
Before
N/A - This is a new component
After
after720.mov
Pre-merge author checklist
Pre-merge reviewer checklist