You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use shimmerBackgroundColors prop for custom gradient colors in shimmer effect
#4
Overview
Currently, the shimmer effect is driven by the single shimmerBackgroundColor prop, which forces a hardcoded gradient composed of the provided color and white. This limits design flexibility, as it always renders a gradient of the passed color fading into white.
Proposal
Introduce a new prop named shimmerBackgroundColors (instead of shimmerBackgroundColor) that accepts an array of colors (for example, two colors) to define the gradient used in the shimmer effect. When provided, the shimmer layer’s colors should be set to the values from this array, thereby allowing fully customizable gradients. The API should remain backward compatible by falling back to the current behavior if no custom array is provided.
Expected Behavior
Custom Gradient: When an array of two (or more) colors is supplied, use those colors for the gradientLayer’s colors.
Fallback: If no array is provided, continue using the existing behavior with shimmerBackgroundColor and the default gradient (using white).
Flexibility: Optionally support arrays with more than two colors to allow more complex gradients in future enhancements.
Benefits
Design Flexibility: Developers can better match the shimmer effect to their app’s color scheme.
Improved Customization: Eliminates the hardcoded limitation, offering a more tailored and modern UI experience.
Backward Compatibility: Existing implementations will work as before, ensuring a smooth transition.
Example Usage
// Custom shimmer effect using an array of colors
<AutoSkeletonView isLoading={isLoading} shimmerBackgroundColors={['#f00', '#0f0']}>
// Existing behavior remains unchanged if no colors are provided
<AutoSkeletonView isLoading={isLoading} shimmerBackgroundColor='#f00'>
This enhancement would enable a more dynamic and visually appealing shimmer effect while maintaining simplicity and backward compatibility. I look forward to your feedback on this proposal.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Overview
Currently, the shimmer effect is driven by the single
shimmerBackgroundColorprop, which forces a hardcoded gradient composed of the provided color and white. This limits design flexibility, as it always renders a gradient of the passed color fading into white.Proposal
Introduce a new prop named
shimmerBackgroundColors(instead ofshimmerBackgroundColor) that accepts an array of colors (for example, two colors) to define the gradient used in the shimmer effect. When provided, the shimmer layer’s colors should be set to the values from this array, thereby allowing fully customizable gradients. The API should remain backward compatible by falling back to the current behavior if no custom array is provided.Expected Behavior
shimmerBackgroundColorand the default gradient (using white).Benefits
Example Usage
This enhancement would enable a more dynamic and visually appealing shimmer effect while maintaining simplicity and backward compatibility. I look forward to your feedback on this proposal.
All reactions