Class: Shadcn::SkeletonComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/shadcn/skeleton_component.rb

Overview

Skeleton component for loading placeholders Matches shadcn/ui Skeleton component

Examples:

Basic skeleton

<%= render Shadcn::SkeletonComponent.new(class_name: "h-4 w-[250px]") %>

Circle skeleton (for avatars)

<%= render Shadcn::SkeletonComponent.new(class_name: "h-12 w-12 rounded-full") %>

Card skeleton

<div class="flex flex-col space-y-3">
  <%= render Shadcn::SkeletonComponent.new(class_name: "h-[125px] w-[250px] rounded-xl") %>
  <div class="space-y-2">
    <%= render Shadcn::SkeletonComponent.new(class_name: "h-4 w-[250px]") %>
    <%= render Shadcn::SkeletonComponent.new(class_name: "h-4 w-[200px]") %>
  </div>
</div>

Constant Summary collapse

BASE_CLASSES =
"animate-pulse rounded-md bg-primary/10"

Instance Attribute Summary

Attributes inherited from BaseComponent

#class_name, #data, #html_options

Method Summary

Methods inherited from BaseComponent

#content, #initialize

Methods included from Rails::Helpers::ClassNameHelper

#cn

Constructor Details

This class inherits a constructor from Shadcn::BaseComponent