mrshanebarron/progress
Composer 安装命令:
composer require mrshanebarron/progress
包简介
Progress bar component for Laravel - supports Livewire and Vue
README 文档
README
A progress bar component for Laravel applications. Supports multiple colors, sizes, labels, and animated stripes. Works with Livewire and Vue 3.
Installation
composer require mrshanebarron/progress
Livewire Usage
Basic Usage
<livewire:sb-progress :value="75" />
With Label
<livewire:sb-progress :value="65" :show-label="true"> Upload Progress </livewire:sb-progress>
Different Colors
<livewire:sb-progress :value="80" color="blue" /> <livewire:sb-progress :value="60" color="green" /> <livewire:sb-progress :value="40" color="red" /> <livewire:sb-progress :value="50" color="yellow" /> <livewire:sb-progress :value="70" color="purple" />
Different Sizes
<livewire:sb-progress :value="75" size="sm" /> <livewire:sb-progress :value="75" size="md" /> <livewire:sb-progress :value="75" size="lg" /> <livewire:sb-progress :value="75" size="xl" />
Striped & Animated
<livewire:sb-progress :value="50" :striped="true" /> <livewire:sb-progress :value="50" :striped="true" :animated="true" />
Custom Max Value
<livewire:sb-progress :value="30" :max="50" :show-label="true"> 30 of 50 items </livewire:sb-progress>
Livewire Props
| Prop | Type | Default | Description |
|---|---|---|---|
value |
number | 0 |
Current progress value |
max |
number | 100 |
Maximum value |
size |
string | 'md' |
Size: sm, md, lg, xl |
color |
string | 'blue' |
Color theme |
show-label |
boolean | false |
Show percentage label |
striped |
boolean | false |
Add stripe pattern |
animated |
boolean | false |
Animate stripes |
Vue 3 Usage
Setup
import { SbProgress } from './vendor/sb-progress'; app.component('SbProgress', SbProgress);
Basic Usage
<template> <SbProgress :value="75" /> </template>
With Label
<template> <SbProgress :value="progress" :show-label="true"> Upload Progress </SbProgress> </template> <script setup> import { ref } from 'vue'; const progress = ref(45); </script>
Colors
<template> <SbProgress :value="80" color="blue" /> <SbProgress :value="60" color="green" /> <SbProgress :value="40" color="red" /> <SbProgress :value="50" color="yellow" /> <SbProgress :value="70" color="purple" /> <SbProgress :value="30" color="gray" /> </template>
Sizes
<template> <SbProgress :value="75" size="sm" /> <!-- 4px height --> <SbProgress :value="75" size="md" /> <!-- 8px height --> <SbProgress :value="75" size="lg" /> <!-- 16px height --> <SbProgress :value="75" size="xl" /> <!-- 24px height --> </template>
Striped Progress
<template> <!-- Static stripes --> <SbProgress :value="50" striped /> <!-- Animated stripes --> <SbProgress :value="50" striped animated /> </template>
File Upload Example
<template> <div class="space-y-2"> <div class="flex justify-between text-sm"> <span>{{ file.name }}</span> <span>{{ formatBytes(file.size) }}</span> </div> <SbProgress :value="uploadProgress" :color="uploadProgress === 100 ? 'green' : 'blue'" striped :animated="uploadProgress < 100" /> </div> </template>
Multi-Step Progress
<template> <SbProgress :value="currentStep" :max="totalSteps" :show-label="true" color="purple" size="lg" > Step {{ currentStep }} of {{ totalSteps }} </SbProgress> </template> <script setup> const currentStep = ref(2); const totalSteps = 5; </script>
Vue Props
| Prop | Type | Default | Description |
|---|---|---|---|
value |
Number | 0 |
Current value |
max |
Number | 100 |
Maximum value |
size |
String | 'md' |
Height: sm, md, lg, xl |
color |
String | 'blue' |
Color: blue, green, red, yellow, purple, gray |
showLabel |
Boolean | false |
Display percentage |
striped |
Boolean | false |
Stripe pattern overlay |
animated |
Boolean | false |
Animate stripe movement |
Slots
| Slot | Description |
|---|---|
| default | Label text (left side) |
Size Reference
| Size | Height |
|---|---|
sm |
4px |
md |
8px |
lg |
16px |
xl |
24px |
Color Options
| Color | Class |
|---|---|
blue |
bg-blue-600 |
green |
bg-green-600 |
red |
bg-red-600 |
yellow |
bg-yellow-500 |
purple |
bg-purple-600 |
gray |
bg-gray-600 |
Accessibility
role="progressbar"attributearia-valuenow,aria-valuemin,aria-valuemax- Percentage label for screen readers
Requirements
- PHP 8.1+
- Laravel 10, 11, or 12
- Tailwind CSS 3.x
License
MIT License
mrshanebarron/progress 适用场景与选型建议
mrshanebarron/progress 是一款 基于 Vue 开发的 Composer 扩展包,目前已累计 14 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 12 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「progress」 「loading」 「vue」 「progress-bar」 「livewire」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mrshanebarron/progress 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mrshanebarron/progress 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mrshanebarron/progress 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Laravel API Resources supercharged to get rid of N+1 problems.
Integrates data-mapper in Symfony projects.
Port of Facebook's dataloader to PHP
PACE (Progress Automatically Certain to Entertain) - Automatic page load progress bar for Yii PHP Framework
Provides a proxy class factory to load services in a lazy and seamless way
Reusable progress bar components for Filament 5 tables and infolists.
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 28
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-14