Skeleton

free

Skeleton holds layout space while data or media is still loading.

import Skeleton from '@/components/ui/skeleton';

export default function UsageDemo() {
  return (

Installation

Add this component with the NateUI CLI.

npx nateui@latest add Skeleton

Examples

Variant

import Skeleton from '@/components/ui/skeleton';

export default function VariantDemo() {
  return (

Size

import Skeleton from '@/components/ui/skeleton';

export default function SizeDemo() {
  return (

Animation

Animated
Static
import Skeleton from '@/components/ui/skeleton';

export default function AnimationDemo() {
  return (

API

Skeleton renders a tokenized placeholder element. Compose several skeletons together to preserve the shape of the content that is loading.

PropDescriptionTypeDefault
animationWhether the placeholder pulses.booleantrue
asElementElement or component used for the rendered node.ElementType'span'
classNameClass names applied to the skeleton element.string-
heightHeight as pixels or a CSS size.string | number-
refRef forwarded to the rendered element.Ref<ElementType>-
styleInline styles applied to the rendered element.CSSProperties-
variantShape of the placeholder.SkeletonVariant'block'
widthWidth as pixels or a CSS size.string | number-
...nativePropsNative props for the rendered element.ComponentProps<ElementType>-

Types

type SkeletonVariant = 'block' | 'circle';