Skeletons

Skeletons are used to show a placeholder for content that is loading or being fetched. They are often used to give the user an idea of what the content will look like before it is loaded.

Basic Skeletons

Skeletons can take on various shapes and sizes that you define.

Preview
Code
.flex.flex-col.gap-4.w-72
  .flex.items-center.gap-4
    = daisy_skeleton(css: "size-24 rounded-full")

    = daisy_skeleton(css: "w-36 h-20")

  - 3.times do |i|
    - width = i.even? ? "w-36" : "w-48"
    = daisy_skeleton(css: "#{width} h-5")

Skeleton Text

Use skeleton-text alongside skeleton to animate placeholder text with the same shimmer gradient. This is useful for text-only loading states such as AI-generated content or dynamic labels.

Preview
AI is thinking... Loading your content... Fetching results...
Code
.flex.flex-col.gap-4.w-72
  %span.skeleton.skeleton-text.text-2xl.font-bold AI is thinking...
  %span.skeleton.skeleton-text.text-base Loading your content...
  %span.skeleton.skeleton-text.text-sm.w-48 Fetching results...

Component Skeletons

You can also use skeletons to show placeholders for components by adding the skeleton class to many existing components.

When applying a skeleton to a placeholder avatar (one with no src or icon), pass wrapper_css: "skeleton" — the avatar component detects the skeleton class and automatically suppresses its default bg-neutral so the skeleton shimmer color shows correctly.

Preview
Loading...
Here is text that won't be displayed...
Here is a lot more text that won't be displayed and people can't see...
Here is some more text that won't be displayed...
Code
.flex.flex-col.gap-8
  .flex.items-center.gap-8
    = daisy_badge(css: "badge-lg skeleton text-transparent") do
      Loading...

    .w-12.md:w-48

    = daisy_button(css: "skeleton text-transparent") do
      Loading...

    = daisy_button(css: "skeleton skeleton-text") do
      Loading...

  = daisy_alert(css: "skeleton")

  = daisy_chat do |chat|
    - chat.with_avatar(wrapper_css: "skeleton")
    - chat.with_bubble(css: "skeleton text-transparent") do
      Here is text that won't be displayed...

  = daisy_chat do |chat|
    - chat.with_avatar(wrapper_css: "skeleton")
    - chat.with_bubble(css: "skeleton text-transparent") do
      Here is a lot more text that won't be displayed and people can't see...

  = daisy_chat(css: "chat-end") do |chat|
    - chat.with_avatar(wrapper_css: "skeleton")
    - chat.with_bubble(css: "skeleton text-transparent") do
      Here is some more text that won't be displayed...
Made with by Profoundry .
Copyright © 2023-2026 Profoundry LLC.
All rights reserved.