Skip to content
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: add Skeleton component and SkeletonWrapper component #436

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hunterbecton
Copy link
Contributor

What/Why

This PR introduces a Skeleton primitive to VIBES that will help streamline the creation of skeleton loaders across the project. I'm also proposing a SkeletonWrapper component to simplify the process of creating component skeletons because it automatically handles accessibility and removes the need of using data-pending in order to handle skeleton animations.

Skeleton component

  • Provides a versatile loading placeholder component with multiple types: text, image, box, and circle
  • Supports theming through CSS variables, allowing customization of the skeleton's background color
  • Offers a variety of border-radius options (sm, base, md, lg, xl, 2xl, 3xl, full) for rounded corners
  • Allows specification of characterCount for text type to determine the width of the placeholder
  • Supports aspectRatio for image type with predefined ratios (5:6, 3:4, 1:1)

SkeletonWrapper component

  • Wraps children components with a pulsing animation to indicate loading state
  • Includes accessibility features with a role="status" and a visually hidden "Loading..." text for screen readers

Testing

CleanShot.2024-12-22.at.20.38.26.mp4

Copy link

linear bot commented Dec 23, 2024

Copy link

vercel bot commented Dec 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vibes ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 23, 2024 1:58am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant