定制 zayne/zayneui 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

zayne/zayneui

最新稳定版本:v1.1.20

Composer 安装命令:

composer require zayne/zayneui

包简介

A Laravel Blade component library. Install once, own everything.

README 文档

README

A Laravel Blade component library. Install once, own everything.

Requirements

  • PHP 8.2+
  • Laravel 11 or 12
  • Tailwind CSS v4
  • Vite

Installation

composer require zayne/ui
php artisan zayne:install

The install command will:

  • Copy all components, CSS, and JS into your app
  • Register App\Providers\ZayneServiceProvider in bootstrap/providers.php
  • Inject CSS imports into resources/css/app.css
  • Inject the JS import into resources/js/app.js

Setup

1. Add to your layout <head>:

@zayneStyles

This outputs your Vite assets and restores the saved theme + sidebar state before the first paint.

2. Add before </body>:

@zayneScripts

3. Set a theme on <html>:

<html class="light">
<html class="dark">
<html class="abyss">

Theming

The only file you should edit is:

resources/css/zayne-theme.css

All design tokens are CSS custom properties. Three themes are included: light, dark, and abyss.

Token Description
--zayne-color-primary Brand primary
--zayne-color-secondary Brand secondary
--zayne-color-accent Accent color
--zayne-color-base-100 Page background
--zayne-color-base-200 Surface background
--zayne-color-base-content Body text
--zayne-color-danger Error / destructive
--zayne-color-success Success state
--zayne-color-warning Warning state
--zayne-color-info Info state

Usage

<x-zayne.button>Save</x-zayne.button>

<x-zayne.button variant="outline" color="danger">Delete</x-zayne.button>

<x-zayne.button variant="soft" color="success" size="sm">
    <x-slot:leftIcon>...</x-slot:leftIcon>
    Saved
</x-zayne.button>

Button props

Prop Type Default Values
variant string solid solid soft outline dashed ghost link
color string base primary secondary accent base danger success warning info
size string md xs sm md lg xl
href string null Renders as <a> when set
disabled bool false
fullWidth bool false
square bool false Equal width/height (icon buttons)

JavaScript API

State is exposed globally:

Zayne.Theme.set('dark')      // 'light' | 'dark' | 'abyss'
Zayne.Theme.toggle()

Zayne.Sidebar.toggle()
Zayne.Sidebar.collapse()
Zayne.Sidebar.expand()

Zayne.Subbar.toggle()

Updating

composer update zayne/ui
php artisan zayne:install --force

--force overwrites all installed files. Your zayne-theme.css will be overwritten — back it up before updating if you've customised it, or keep your theme tokens in a separate file and @import them.

Rules

  • ✅ Edit zayne-theme.css to customise your theme
  • ❌ Do not edit component PHP classes
  • ❌ Do not edit Blade templates
  • ❌ Do not edit zayne-layout.css or zayne-overlay.css
  • ❌ Do not edit zayne.js or its modules

License

MIT

统计信息

  • 总下载量: 33
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固