Skeleton
The Skeleton component provides you with loading placeholders.
Import
import { Skeleton } from '@nostromo/ui-core'
// or
import { Skeleton } from '@nostromo/ui-core/skeleton'Usage
import { Skeleton } from '@nostromo/ui-core'
export default function Example() {
return (
<Skeleton className="h-4 w-[250px]" />
)
}Live Examples
Live Example
View Code
import { Skeleton } from '@nostromo/ui-core'
export default function SkeletonExample() {
return (
<div className="space-y-4">
<Skeleton className="h-4 w-[250px]" />
<Skeleton className="h-4 w-[200px]" />
<Skeleton className="h-4 w-[150px]" />
</div>
)...
Card Skeleton
Live Example
View Code
import { Skeleton } from '@nostromo/ui-core'
export default function CardSkeleton() {
return (
<div className="space-y-4">
<Skeleton className="h-4 w-[250px]" />
<Skeleton className="h-4 w-[200px]" />
<Skeleton className="h-4 w-[150px]" />
<Skeleton className="h-4 w-[100px]" />
</div>...
Props
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
shape | "default" | "circle" | "square" | "default" | No | Shape of the skeleton |
size | "sm" | "default" | "lg" | "default" | No | Size of the skeleton |
width | string | number | undefined | No | Width of the skeleton |
height | string | number | undefined | No | Height of the skeleton |
lines | number | undefined | No | Number of lines (for text skeleton) |
spacing | "none" | "sm" | "md" | "lg" | "md" | No | Spacing between lines |
loading | boolean | true | No | Whether skeleton is in loading state |
className | string | undefined | No | Additional CSS classes |
children | React.ReactNode | undefined | No | Skeleton content |
Standard HTML Props
The Skeleton component extends standard HTML div attributes (e.g., id, data-*, aria-*).