mrshanebarron/skeleton
Composer 安装命令:
composer require mrshanebarron/skeleton
包简介
Skeleton loading placeholder component for Laravel - supports Livewire and Vue
README 文档
README
A loading placeholder component for Laravel applications. Shows animated skeleton screens while content loads. Works with Livewire and Vue 3.
Installation
composer require mrshanebarron/skeleton
Livewire Usage
Basic Text Skeleton
<livewire:sb-skeleton />
Different Variants
<livewire:sb-skeleton variant="text" /> <livewire:sb-skeleton variant="title" /> <livewire:sb-skeleton variant="avatar" /> <livewire:sb-skeleton variant="thumbnail" /> <livewire:sb-skeleton variant="card" /> <livewire:sb-skeleton variant="button" />
Multiple Lines
<livewire:sb-skeleton :count="3" />
Custom Dimensions
<livewire:sb-skeleton width="200px" height="40px" />
Without Animation
<livewire:sb-skeleton :animate="false" />
Livewire Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant |
string | 'text' |
Preset shape |
width |
string | null |
Custom width |
height |
string | null |
Custom height |
animate |
boolean | true |
Pulse animation |
count |
number | 1 |
Number of skeleton items |
Vue 3 Usage
Setup
import { SbSkeleton } from './vendor/sb-skeleton'; app.component('SbSkeleton', SbSkeleton);
Basic Usage
<template> <SbSkeleton /> </template>
Variants
<template> <!-- Single line text --> <SbSkeleton variant="text" /> <!-- Larger title line --> <SbSkeleton variant="title" /> <!-- Circular avatar --> <SbSkeleton variant="avatar" /> <!-- Square thumbnail --> <SbSkeleton variant="thumbnail" /> <!-- Large card shape --> <SbSkeleton variant="card" /> <!-- Button shape --> <SbSkeleton variant="button" /> </template>
Multiple Lines
<template> <!-- 3 text lines --> <SbSkeleton variant="text" :count="3" /> </template>
Custom Dimensions
<template> <SbSkeleton width="100%" height="200px" /> </template>
Card Loading State
<template> <div class="border rounded-lg p-4"> <template v-if="loading"> <SbSkeleton variant="thumbnail" class="w-full h-48 mb-4" /> <SbSkeleton variant="title" class="mb-2" /> <SbSkeleton variant="text" :count="2" /> </template> <template v-else> <img :src="card.image" class="w-full h-48 object-cover rounded mb-4" /> <h3 class="font-bold">{{ card.title }}</h3> <p>{{ card.description }}</p> </template> </div> </template>
User List Skeleton
<template> <div v-if="loading" class="space-y-4"> <div v-for="i in 5" :key="i" class="flex items-center gap-4"> <SbSkeleton variant="avatar" /> <div class="flex-1"> <SbSkeleton variant="title" class="w-1/4 mb-2" /> <SbSkeleton variant="text" class="w-1/2" /> </div> </div> </div> <div v-else> <!-- Actual user list --> </div> </template>
Article Skeleton
<template> <div v-if="loading"> <SbSkeleton variant="title" class="w-3/4 mb-4" /> <div class="flex gap-2 mb-4"> <SbSkeleton variant="avatar" class="w-6 h-6" /> <SbSkeleton variant="text" class="w-24" /> <SbSkeleton variant="text" class="w-20" /> </div> <SbSkeleton variant="card" class="h-64 mb-4" /> <SbSkeleton variant="text" :count="6" /> </div> </template>
Vue Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant |
String | 'text' |
Shape preset |
width |
String | null |
Custom CSS width |
height |
String | null |
Custom CSS height |
animate |
Boolean | true |
Enable pulse animation |
count |
Number | 1 |
Number of items to render |
Variant Reference
| Variant | Description | Default Size |
|---|---|---|
text |
Single line text | h-4, full width |
title |
Heading text | h-6, 75% width |
avatar |
User avatar | 40x40px, circular |
thumbnail |
Image thumbnail | 80x80px |
card |
Card placeholder | h-32, full width |
button |
Button shape | h-10, w-24 |
Features
- Preset Variants: Common shapes built-in
- Custom Sizing: Override with width/height
- Animation: Pulse effect for loading indication
- Multiple Items: Render several at once
Styling
Uses Tailwind CSS:
- Gray background (gray-200)
- Pulse animation
- Rounded corners per variant
Use Cases
- Page loading states
- Data fetching placeholders
- Image loading
- Form skeleton
- List loading states
Requirements
- PHP 8.1+
- Laravel 10, 11, or 12
- Tailwind CSS 3.x
License
MIT License
mrshanebarron/skeleton 适用场景与选型建议
mrshanebarron/skeleton 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 12 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「placeholder」 「laravel」 「Skeleton」 「loading」 「vue」 「livewire」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mrshanebarron/skeleton 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mrshanebarron/skeleton 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mrshanebarron/skeleton 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A plugin which generates an invisible SVG of specific dimensions for use when lazyloading images in Craft CMS templates.
Module for ProcessWire which automatically generates Blurhashs.
The PDO wrapper with comfortable API for placeholders
Slim starter / Slim skeleton package to boost your development with Slim framework
Easily add placeholder images in TYPO3 using either external sources (like placeholder.com) or generating them on the fly.
Easy system for working with placeholders in texts
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-14