mrshanebarron/empty-state
Composer 安装命令:
composer require mrshanebarron/empty-state
包简介
Empty state placeholder component for Laravel - supports Livewire and Vue
README 文档
README
An empty state placeholder component for Laravel applications. Displays friendly messages when content is missing. Works with Livewire and Vue 3.
Installation
composer require mrshanebarron/empty-state
Livewire Usage
Basic Usage
<livewire:sb-empty-state title="No items found" description="Get started by creating your first item." />
With Icon
<livewire:sb-empty-state title="No messages" description="Your inbox is empty." icon="inbox" />
With Action Button
<livewire:sb-empty-state title="No projects" description="Create a project to get started." action-text="Create Project" action-url="/projects/create" />
Livewire Props
| Prop | Type | Default | Description |
|---|---|---|---|
title |
string | 'No items' |
Main heading |
description |
string | null |
Subtext description |
icon |
string | null |
Icon name/type |
action-text |
string | null |
Button text |
action-url |
string | null |
Button link |
Vue 3 Usage
Setup
import { SbEmptyState } from './vendor/sb-empty-state'; app.component('SbEmptyState', SbEmptyState);
Basic Usage
<template> <SbEmptyState title="No results found" description="Try adjusting your search or filters." /> </template>
With Icon
<template> <SbEmptyState title="No notifications" description="You're all caught up!" icon="bell" /> </template>
With Action
<template> <SbEmptyState title="No team members" description="Invite your team to collaborate." action-text="Invite Team" @action="openInviteModal" /> </template> <script setup> const openInviteModal = () => { // Handle action }; </script>
Conditional Rendering
<template> <div v-if="items.length > 0"> <!-- List items --> </div> <SbEmptyState v-else title="No items yet" description="Create your first item to get started." action-text="Create Item" @action="createItem" /> </template>
Custom Slot Content
<template> <SbEmptyState title="Custom Content"> <template #icon> <MyCustomIcon class="w-12 h-12 text-gray-400" /> </template> <template #description> <p class="text-gray-500"> Need help? <a href="/docs" class="text-blue-500">Read the docs</a> </p> </template> <template #action> <div class="flex gap-2"> <button class="btn-primary">Create</button> <button class="btn-secondary">Import</button> </div> </template> </SbEmptyState> </template>
Vue Props
| Prop | Type | Default | Description |
|---|---|---|---|
title |
String | 'No items' |
Heading text |
description |
String | null |
Description text |
icon |
String | null |
Icon identifier |
actionText |
String | null |
Action button text |
actionUrl |
String | null |
Action link URL |
Events
| Event | Description |
|---|---|
action |
Button clicked (when no actionUrl) |
Slots
| Slot | Description |
|---|---|
icon |
Custom icon content |
description |
Custom description content |
action |
Custom action buttons |
Common Use Cases
- Empty search results
- No data in tables
- Empty inbox/notifications
- New user onboarding
- Filtered results with no matches
Styling
Uses Tailwind CSS:
- Centered layout
- Gray icon
- Large title text
- Muted description
- Primary action button
Requirements
- PHP 8.1+
- Laravel 10, 11, or 12
- Tailwind CSS 3.x
License
MIT License
mrshanebarron/empty-state 适用场景与选型建议
mrshanebarron/empty-state 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 12 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「placeholder」 「laravel」 「vue」 「livewire」 「empty-state」 「no-data」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mrshanebarron/empty-state 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mrshanebarron/empty-state 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mrshanebarron/empty-state 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A component that allows creating responsive HTML tables or lists from data object
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.
Admin panel generator for Laravel 8 and based on Vuetify Admin, a separate SPA admin framework running on top of REST APIs.
Code generation for MPMG projects that use Laravel and VueJs tecnologies.
The PDO wrapper with comfortable API for placeholders
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 19
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-14