Pulsing placeholder for content that is loading, sized through classes.
Loading profile
Loading profile
<x-markas.skeleton shape="rect" class="h-4 w-48" /><x-markas.skeleton shape="circle" class="size-12" />import { Skeleton } from "@/components/markas/Skeleton";
<Skeleton shape="rect" className="h-4 w-48" />import { Skeleton } from "@/components/markas/Skeleton";
<Skeleton shape="circle" className="size-12" />import Skeleton from "@/components/markas/Skeleton.vue";
<Skeleton shape="rect" class="h-4 w-48" />import Skeleton from "@/components/markas/Skeleton.vue";
<Skeleton shape="circle" class="size-12" />Examples
Card
Loading article
Loading article
Loading article
Loading article
Loading article
<div class="grid gap-4 rounded-lg border border-line bg-surface p-4" role="status">
<span class="sr-only">Loading article</span>
<x-markas.skeleton class="h-36 w-full" />
<div class="grid gap-2">
<x-markas.skeleton class="h-5 w-3/4" />
<x-markas.skeleton class="h-4 w-full" />
<x-markas.skeleton class="h-4 w-5/6" />
</div>
<x-markas.skeleton class="h-10 w-28" />
</div>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
<div class="grid gap-3" role="status">
<span class="sr-only">Loading content</span>
<x-markas.skeleton class="h-6 w-1/2" />
<div class="grid gap-2">
<x-markas.skeleton class="h-4 w-full" />
<x-markas.skeleton class="h-4 w-full" />
<x-markas.skeleton class="h-4 w-11/12" />
<x-markas.skeleton class="h-4 w-2/3" />
</div>
</div>Installation
npx markasui@latest add skeletonpnpm dlx markasui@latest add skeletonyarn dlx markasui@latest add skeletonbunx --bun markasui@latest add skeleton- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
resources/views/components/markas/skeleton.blade.php.
resources/views/components/markas/skeleton.blade.php
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/Skeleton.tsx.
src/components/markas/Skeleton.tsx
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/Skeleton.vue.
src/components/markas/Skeleton.vue
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/lib/components/markas/Skeleton.svelte.
src/lib/components/markas/Skeleton.svelte
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/Skeleton.astro.
src/components/markas/Skeleton.astro
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/app/markas/skeleton.component.ts.
src/app/markas/skeleton.component.ts
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 useshape="circle", not therounded-fullclass, because withouttailwind-mergeconflicting radius classes depend on CSS order.
Props
| Name | Type | Default | Description |
|---|---|---|---|
shape | 'rect' | 'circle' | rect | 6px rounded corners, or a full circle for avatars. |
class | string | - | 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.
- AlertIn-page message for important information, with info, success, warning, and danger variants.
- BadgeSmall pill-shaped status label with a colored dot for neutral, primary, success, warning, and danger.
- ProgressProgress bar built on the native progress element, with a label, percentage, and indeterminate mode.
- ToastShort notification in the bottom right corner that dismisses itself, triggered with the toast() function or an event.