admin9/blade-daisyui
Composer 安装命令:
composer require admin9/blade-daisyui
包简介
Blade components for DaisyUI 5 — pure UI, no business logic
README 文档
README
Blade components for DaisyUI 5 — pure UI, zero business logic.
Provides 65 components as anonymous Blade views with a <x-dui::*> prefix, ready to drop into any Laravel 11/12 project that uses Tailwind CSS + DaisyUI 5.
Requirements
- PHP 8.2+
- Laravel 11 or 12
- Tailwind CSS 4 + DaisyUI 5 (installed in your project)
Installation
composer require admin9/blade-daisyui
The package auto-discovers its service provider. No manual registration needed.
Usage
All components use the dui namespace:
{{-- Button --}} <x-dui::button color="primary">Click me</x-dui::button> {{-- Card --}} <x-dui::card> <x-dui::card.body> <x-dui::card.title>Hello</x-dui::card.title> <p>Card content here.</p> <x-dui::card.actions> <x-dui::button color="primary">Buy Now</x-dui::button> </x-dui::card.actions> </x-dui::card.body> </x-dui::card> {{-- Badge --}} <x-dui::badge color="secondary">New</x-dui::badge> {{-- Alert --}} <x-dui::alert color="info">Heads up!</x-dui::alert> {{-- Modal --}} <x-dui::modal id="my-modal"> <x-dui::modal.box>Modal content</x-dui::modal.box> </x-dui::modal>
Components (65)
Actions
accordion, alert, button, dropdown, fab, loading, modal, progress, radial-progress, skeleton, swap, toast, tooltip
Data Display
avatar, badge, card, carousel, chat, countdown, diff, kbd, list, stat, status, table, timeline
Data Input
calendar, checkbox, fieldset, file-input, filter, input, label, radio, range, rating, select, textarea, toggle, validator
Layout
collapse, divider, dock, drawer, footer, hero, indicator, join, mask, navbar, stack
Navigation
breadcrumbs, link, menu, pagination, steps, tab
Mockup
mockup-browser, mockup-code, mockup-phone, mockup-window
Effects
hover-3d, hover-gallery, text-rotate, theme-controller
Props Convention
Components accept DaisyUI modifier props directly:
| Prop | Type | Description |
|---|---|---|
color |
string | DaisyUI color: primary, secondary, accent, info, success, warning, error |
size |
string | Size modifier: xs, sm, md, lg, xl |
variant |
string | Style variant: outline, soft, dash, ghost, link (component-specific) |
All extra HTML attributes are forwarded to the root element via $attributes->merge().
Customizing Classes
Every component merges your classes with its defaults:
{{-- Adds "mt-4" alongside the built-in "btn btn-primary" --}} <x-dui::button color="primary" class="mt-4">Go</x-dui::button>
Visual Review
The package now includes curated example views under the blade-daisyui::examples.* namespace. Mount them in any Laravel app to exercise the components together and validate the visual hierarchy described in docs/visual-audit.md :
use Illuminate\Support\Facades\Route; Route::view('/dui/control-room', 'blade-daisyui::examples.control-room'); Route::view('/dui/landing-editorial', 'blade-daisyui::examples.landing-editorial'); Route::view('/dui/settings-lab', 'blade-daisyui::examples.settings-lab');
blade-daisyui::examples.control-roomis the administrative control surface that stresses hierarchy, density, tables, alerts, and complex form combinations.blade-daisyui::examples.landing-editorialis a content-marketing scene that proves the same toolkit can compose gradients, hero storytelling, and layered badges without collapsing into a generic layout.blade-daisyui::examples.settings-labis the form-heavy settings scene that stresses neutral controls, validation, filters, toggles, radios, and dense field groupings.
Use the docs/visual-audit.md checklist while stepping through both scenes so you notice density shifts, theme transitions, badge pressure, and form behavior before releasing component changes.
For component-level conclusions, see docs/component-audit.md. That file summarizes which high-frequency primitives are visually stable, which ones are easy to misuse, and where follow-up work is actually worth doing.
Recommended: Publish The Host Stubs
The package example views are content-only partials. The fastest way to use them in a real Laravel app is to publish the host wrapper views and the Tailwind/DaisyUI CSS stub:
php artisan vendor:publish --tag=blade-daisyui-stubs
This will publish:
resources/views/blade-daisyui/control-room.blade.phpresources/views/blade-daisyui/landing-editorial.blade.phpresources/views/blade-daisyui/settings-lab.blade.phpresources/css/vendor/blade-daisyui-examples.css
The published wrapper views use:
<x-layouts.app> @include('blade-daisyui::examples.control-room') </x-layouts.app>
If your app uses a different layout component or a section-based layout, just edit the published stubs and replace <x-layouts.app> with your preferred wrapper.
Minimal Host App Routes
Once the wrapper views are published, point routes to the host views instead of the package partials:
use Illuminate\Support\Facades\Route; Route::view('/dui/control-room', 'blade-daisyui.control-room'); Route::view('/dui/landing-editorial', 'blade-daisyui.landing-editorial'); Route::view('/dui/settings-lab', 'blade-daisyui.settings-lab');
Minimal Host App Styling Requirements
The published CSS stub contains the required Tailwind + DaisyUI imports and scans the package Blade files:
@import "tailwindcss"; @plugin "daisyui"; @source "../views/**/*.blade.php"; @source "../js/**/*.js"; @source "../../vendor/admin9/blade-daisyui/resources/views/**/*.blade.php";
Make sure your layout still loads the compiled assets, for example:
@vite(['resources/css/app.css', 'resources/js/app.js'])
Testing
composer test
License
MIT. See LICENSE.md.
admin9/blade-daisyui 适用场景与选型建议
admin9/blade-daisyui 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 12 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「components」 「laravel」 「blade」 「tailwind」 「DaisyUI」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 admin9/blade-daisyui 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 admin9/blade-daisyui 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 admin9/blade-daisyui 相关的其它包
同方向 / 同关键字的高下载量 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
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 27
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-28