hehecoding / laragen-ui-kit
LaraGEN应用的Blade组件UI套件
1.9.3
2023-07-05 13:16 UTC
Requires
- php: ^8.1
- illuminate/contracts: ^9.0
- spatie/laravel-package-tools: ^1.13.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^6.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^7.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2024-09-30 11:15:36 UTC
README
安装
您可以通过Composer安装此包
composer require hehecoding/laragen-ui-kit
您可以使用以下命令发布配置文件
php artisan vendor:publish --tag="laragen-ui-kit-config"
这是已发布配置文件的内容
return [
];
可选地,您可以使用以下命令发布视图
php artisan vendor:publish --tag="laragen-ui-kit-views"
测试
composer test
组件
1. 按钮
Laragen按钮组件是Laravel Blade的一个可定制按钮组件,使用Tailwind CSS类。它支持各种属性来自定义按钮的外观和行为。
用法
要使用Laragen按钮组件,您可以在Blade视图中包含它,如下所示
<x-laragen::button color="error" size="xs" rounded="lg">
{{ $slot }}
</x-laragen::button>
{{ $slot }}
将被替换为您想要在按钮中显示的文本或HTML内容。
属性
以下属性适用于Laragen按钮组件
color
(字符串,可选):按钮的颜色。可用选项为primary(默认)、success和error。variant
(字符串,可选):按钮的样式。可用选项为default(默认)、tonal、outlined、plain和text。block
(布尔值,可选):按钮是否应占据其容器的全部宽度。rounded
(字符串,可选):按钮的圆角。可用选项为sm、normal(默认)、lg、0和pill。disabled
(布尔值,可选):按钮是否应被禁用。icon
(字符串,可选):要显示在按钮中的Font Awesome图标的名称。按钮的{{ $slot }}
将被图标替换。iconBefore
(字符串,可选):要显示在按钮文本之前的Font Awesome图标的名称。iconAfter
(字符串,可选):要显示在按钮文本之后的Font Awesome图标的名称。loading
(布尔值,可选):按钮是否应显示加载指示器。size
(字符串,可选):按钮的大小。可用选项为xs、sm、normal(默认)、lg和xl。href
(字符串,可选):如果提供,按钮将被渲染为具有此URL的锚点标签。
示例
以下是一些使用不同属性的Laragen按钮组件的示例
<!-- A primary button with a custom text and a before icon --> <x-laragen::button color="success" iconBefore="fas fa-plus">Add Item</x-laragen::button> <!-- A disabled button with a loading spinner --> <x-laragen::button disabled loading></x-laragen::button> <!-- A link button with an icon --> <x-laragen::button href="/" icon="fas fa-home"></x-laragen::button> <!-- A text-only button --> <x-laragen::button variant="text">Cancel</x-laragen::button>
变更日志
有关最近更改的更多信息,请参阅变更日志
贡献
有关详细信息,请参阅贡献指南
安全漏洞
有关如何报告安全漏洞的详细信息,请参阅我们的安全策略
致谢
许可证
MIT许可证(MIT)。有关更多信息,请参阅许可证文件