Skip to content
MarkasUI
Type to search

    Guide

    MarkasUI

    Form

    Feedback

    Overlay

    Navigation

    Data

    Sections

    Animations

    Backgrounds

    Buttons

    Templates

    Pages

    Skeleton

    Pulsing placeholder for content that is loading, sized through classes.

    Loading profile
    Loading profile

    Skeleton

    <x-markas.skeleton shape="rect" class="h-4 w-48" />
    import { Skeleton } from "@/components/markas/Skeleton";
    
    <Skeleton shape="rect" className="h-4 w-48" />
    import Skeleton from "@/components/markas/Skeleton.vue";
    
    <Skeleton shape="rect" class="h-4 w-48" />
    <script lang="ts">
      import Skeleton from "$lib/components/markas/Skeleton.svelte";
    </script>
    
    <div
      class="flex items-center gap-4 rounded-lg border border-line bg-surface p-4"
      role="status"
    >
      <span class="sr-only">Loading profile</span>
      <Skeleton shape="circle" class="size-12 shrink-0" />
      <div class="grid flex-1 gap-2">
        <Skeleton class="h-4 w-2/3" />
        <Skeleton class="h-4 w-1/2" />
      </div>
    </div>
    ---
    import Skeleton from "@/components/markas/Skeleton.astro";
    ---
    
    <div
      class="flex items-center gap-4 rounded-lg border border-line bg-surface p-4"
      role="status"
    >
      <span class="sr-only">Loading profile</span>
      <Skeleton shape="circle" class="size-12 shrink-0" />
      <div class="grid flex-1 gap-2">
        <Skeleton class="h-4 w-2/3" />
        <Skeleton class="h-4 w-1/2" />
      </div>
    </div>
    import { Component } from "@angular/core";
    import { Skeleton } from "./markas/skeleton.component";
    
    @Component({
      selector: "markas-example",
      imports: [Skeleton],
      template: `
        <div
          class="flex items-center gap-4 rounded-lg border border-line bg-surface p-4"
          role="status"
        >
          <span class="sr-only">Loading profile</span>
          <div markas-skeleton shape="circle" class="size-12 shrink-0"></div>
          <div class="grid flex-1 gap-2">
            <div markas-skeleton class="h-4 w-2/3"></div>
            <div markas-skeleton class="h-4 w-1/2"></div>
          </div>
        </div>
      `,
    })
    export default class SkeletonExample {}

    Examples

    Card

    Loading article
    Loading article
    Loading article
    Loading article
    Loading article

    List

    Loading messages
    Loading messages
    Loading messages
    Loading messages
    Loading messages

    Profile

    Loading profile
    Loading profile
    Loading profile
    Loading profile
    Loading profile

    Text

    Loading content
    Loading content
    Loading content
    Loading content
    Loading content

    Installation

    npx markasui@latest add skeleton

    Usage

    <div class="flex items-center gap-4" role="status">
        <span class="sr-only">Loading profile</span>
        <x-markas.skeleton shape="circle" class="size-12 shrink-0" />
        <div class="grid flex-1 gap-2">
            <x-markas.skeleton class="h-4 w-2/3" />
            <x-markas.skeleton class="h-4 w-1/2" />
        </div>
    </div>
    import { Skeleton } from "@/components/markas/Skeleton";
    
    <div className="flex items-center gap-4" role="status">
      <span className="sr-only">Loading profile</span>
      <Skeleton shape="circle" className="size-12 shrink-0" />
      <div className="grid flex-1 gap-2">
        <Skeleton className="h-4 w-2/3" />
        <Skeleton className="h-4 w-1/2" />
      </div>
    </div>;
    <script setup lang="ts">
    import Skeleton from "@/components/markas/Skeleton.vue";
    </script>
    
    <template>
      <div class="flex items-center gap-4" role="status">
        <span class="sr-only">Loading profile</span>
        <Skeleton shape="circle" class="size-12 shrink-0" />
        <div class="grid flex-1 gap-2">
          <Skeleton class="h-4 w-2/3" />
          <Skeleton class="h-4 w-1/2" />
        </div>
      </div>
    </template>
    <script lang="ts">
      import Skeleton from "$lib/components/markas/Skeleton.svelte";
    </script>
    
    <div class="flex items-center gap-4" role="status">
      <span class="sr-only">Loading profile</span>
      <Skeleton shape="circle" class="size-12" />
      <Skeleton class="h-4 w-1/2" />
    </div>
    ---
    import Skeleton from "@/components/markas/Skeleton.astro";
    ---
    
    <div class="flex items-center gap-4" role="status">
      <span class="sr-only">Loading profile</span>
      <Skeleton shape="circle" class="size-12" />
      <Skeleton class="h-4 w-1/2" />
    </div>
    import { Component } from "@angular/core";
    import { Skeleton } from "./markas/skeleton.component";
    
    @Component({
      selector: "app-profile-loading",
      imports: [Skeleton],
      template: `
        <div class="flex items-center gap-4" role="status">
          <span class="sr-only">Loading profile</span>
          <div markas-skeleton shape="circle" class="size-12"></div>
          <div markas-skeleton class="h-4 w-1/2"></div>
        </div>
      `,
    })
    export class ProfileLoading {}
    • Set the size with classes (h-4 w-1/2, size-12). For a circle use shape="circle", not the rounded-full class, because without tailwind-merge conflicting radius classes depend on CSS order.

    Props

    NameTypeDefaultDescription
    shape'rect' | 'circle'rect6px rounded corners, or a full circle for avatars.
    classstring-Placeholder size, for example h-4 w-1/2 or size-12.

    Accessibility

    • Every skeleton is aria-hidden, so screen readers do not announce empty boxes.
    • Wrap a group of skeletons in role status with sr-only text such as Loading profile.
    • The pulse animation is turned off under prefers-reduced-motion.

    Related components

    More feedback components with the same classes in every framework.