basekit-laravel/basekit-laravel-ui
Composer 安装命令:
composer require basekit-laravel/basekit-laravel-ui
包简介
A modular Laravel UI component library with reusable Blade components, Tailwind 4 theming, and a built-in style guide.
README 文档
README
Basekit Laravel UI
A modular Laravel UI component library built with Blade components, Tailwind 4 CSS, and Alpine.js for rich, interactive interfaces.
Create rich, production‑ready UIs faster with 33 pre‑built components, configurable theming, and a built‑in style guide.
Explore all components in the style guide and read the full docs at basekit‑laravel.github.io/basekit‑laravel‑ui.
🌟 Features
- 🎨 Tailwind 4 CSS‑based theming – Runtime customization via CSS variables.
- ✨ Heroicons integration – Beautiful icons out of the box.
- 🔧 Component toggle & defaults – Enable/disable components and set default variants and sizes.
- 🌲 Component‑aware CSS build – Include CSS only for enabled components.
- 🎯 Type‑safe components – PHP classes with IDE autocomplete.
- 📦 Publishable views – Customize component templates directly.
📦 Installation
Basic Setup
Install via Composer:
composer require basekit-laravel/basekit-laravel-ui
Include the CSS in your main CSS file:
@import "./vendor/basekit-laravel/v1/basekit-ui.css";
Include Alpine.js
Several Basekit components (Accordion, Dropdown Menu, Input password toggle, Modal, Multi-Select, Tabs, Toast, Tooltip, and Table) require Alpine.js. Add it to your layout:
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
Or with Livewire, use @livewireScripts which includes Alpine.js automatically:
@livewireScripts
See the installation guide for more details.
Advanced Setup
Publish the configuration file:
php artisan vendor:publish --tag=basekit-laravel-ui-config
Publish the CSS theme:
php artisan vendor:publish --tag=basekit-laravel-ui-css-v1
Build optimized CSS based on your configuration:
php artisan basekit:ui:build
For development, use watch mode:
php artisan basekit:ui:build --watch
🧩 Available Components
The package includes 33 components organized into 6 categories.
Form Components (8)
Feedback Components (7)
Navigation Components (5)
Layout Components (4)
Display Components (7)
Dialog & Overlay (2)
🧾 Example Form
<x-basekit-ui::container> <x-basekit-ui::card> <x-slot:header> <h2 class="text-xl font-bold">Create Account</h2> </x-slot> <form method="POST" action="/register"> @csrf <x-basekit-ui::stack spacing="lg"> <x-basekit-ui::input name="name" label="Name" icon="user" :error="$errors->first('name')" /> <x-basekit-ui::input name="email" type="email" label="Email" icon="envelope" :error="$errors->first('email')" /> <x-basekit-ui::input name="password" type="password" label="Password" hint="Must be at least 8 characters" icon="lock-closed" :error="$errors->first('password')" /> <x-basekit-ui::checkbox name="terms" label="I agree to the terms and conditions" /> </x-basekit-ui::stack> <x-slot:footer> <div class="flex justify-between items-center"> <x-basekit-ui::link href="/login"> Already have an account? </x-basekit-ui::link> <x-basekit-ui::button type="submit" variant="primary" icon="arrow-right" > Create Account </x-basekit-ui::button> </div> </x-slot> </form> </x-basekit-ui::card> </x-basekit-ui::container>
Browse all available components in the style guide and read the full docs at basekit-laravel.github.io/basekit-laravel-ui.
⚙️ Configuration
Edit config/basekit-laravel-ui.php to customize components:
return [ 'components' => [ 'button' => [ 'enabled' => true, 'variants' => ['primary', 'secondary', 'danger'], 'sizes' => ['sm', 'md', 'lg'], 'default_variant' => 'primary', 'default_size' => 'md', ], // ... more components ], 'icons' => [ 'style' => 'outline', // outline, solid, mini ], 'build' => [ 'debounce_ms' => 500, ], ];
After changing configuration, rebuild CSS:
php artisan basekit:ui:build
For development, use watch mode:
php artisan basekit:ui:build --watch
🎨 Customization
CSS Variables
Override theme variables in your CSS:
:root { --color-primary-600: #your-brand-color; --button-radius: 0.5rem; --card-padding: 2rem; }
See the full list of available variables in the Complete CSS variable reference in the documentation.
Publishing Views
Publish component views for full customization:
php artisan vendor:publish --tag=basekit-views
Published views are copied to resources/views/vendor/basekit/ and automatically override package components.
📐 Styling Conventions
- Component CSS uses BEM with the
bk-prefix (blocks, elements, and modifiers). - Tailwind utilities are for component usage in Blade markup (layout, spacing, overrides).
- When combining classes, Tailwind Merge handles conflicts for the
classattribute.
🧪 CI Quality Checks
The CI workflow validates production readiness on pushes and pull requests by running:
- Feature tests:
php vendor/bin/pest --no-coverage - CSS build:
./vendor/bin/testbench basekit:ui:build - Styleguide generation:
./vendor/bin/testbench basekit:ui:styleguide - CSS/docs token sync guard:
bash tools/verify-doc-token-sync.sh
You can run these locally before opening a pull request.
⚡ Performance
Component‑based builds can significantly reduce bundle size:
- Full bundle (all components): ~200KB
- Minimal config (3 components): ~55KB
- Reduction: 73%
🔄 Migration
See CHANGELOG.md for version changes and migration guides.
📚 Documentation
Full documentation available at:
https://basekit-laravel.github.io/basekit-laravel-ui
See also:
- IMPLEMENTATION.md — Architecture and development guide
- STRUCTURE.md — Component organization and relationships
📄 License
The MIT License (MIT). Please see the LICENSE file for more information.
basekit-laravel/basekit-laravel-ui 适用场景与选型建议
basekit-laravel/basekit-laravel-ui 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 14 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「ui」 「components」 「laravel」 「blade」 「tailwind」 「Heroicons」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 basekit-laravel/basekit-laravel-ui 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 basekit-laravel/basekit-laravel-ui 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 basekit-laravel/basekit-laravel-ui 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Web Font Loader gives you added control when using linked fonts via @font-face.
Ariadne Component Library: xml writer and parser Component
Ariadne Component Library: Cache Component
Ariadne Component Library: hierarchical configuration management Component
Ariadne Component Library: user and group rights management Component
Ariadne Component Library: W3C style events Component
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 34
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-22
