# Skeleton Animated pulse placeholder component for content loading states. Provides multiple preset variants for common UI patterns. ## Installation ```bash deno run -A jsr:@lockness/ui add skeleton ``` ## Usage ```tsx import { Skeleton } from '@lockness/ui/components' // Default skeleton with custom dimensions // Text skeleton // Multiple lines of text // Heading skeleton // Avatar skeleton // Button skeleton // Image skeleton // Card skeleton // Without animation ``` ## Props | Prop | Type | Default | Description | | --------- | ----------------- | ----------- | ---------------------------------- | | `variant` | `SkeletonVariant` | `'default'` | Skeleton variant for common shapes | | `lines` | `number` | `1` | Number of lines (for text variant) | | `animate` | `boolean` | `true` | Whether to animate the skeleton | | `class` | `string` | - | Additional CSS class names | | `id` | `string` | - | Element id attribute | ## Variants | Variant | Description | Dimensions | | --------- | ------------------------------------------ | ------------------------ | | `default` | Base skeleton, requires custom dimensions | Set via `class` | | `text` | Single or multiple text lines | Full width, h-4 per line | | `heading` | Heading placeholder | 75% width, h-8 | | `avatar` | Circular avatar placeholder | 48x48px, rounded-full | | `button` | Button placeholder | 96x40px | | `image` | Image placeholder | Full width, h-48 | | `card` | Complete card with header, image, and text | Full card layout | ## CSS Variables | Variable | Description | | -------------------------- | ------------------------------------- | | `--skeleton-background` | Background color of skeleton elements | | `--skeleton-border-radius` | Border radius of skeleton elements | | `--border` | Border color (for card variant) | ## Examples ### Loading Card ```tsx
``` ### Loading Article ```tsx
``` ### Loading Table Row ```tsx
``` ## Features - **Animated pulse** - Smooth CSS animation for loading indication - **Multiple variants** - Pre-built shapes for common UI patterns - **Multi-line text** - Support for multiple text lines with varying widths - **Disable animation** - Option to turn off animation - **Themeable** - Uses CSS variables for styling