Skip to content

Commit 85ac1af

Browse files
committed
docs
1 parent 1a33b14 commit 85ac1af

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,23 @@ He accept all normal attributes of input tag and add some new attributes:
3232
- label-class: add class to label tag
3333
- other attributes will be added to input tag
3434

35+
### Button component
36+
```html
37+
<x-template-components::button />
38+
```
39+
He accept all normal attributes of button tag and add some new attributes:
40+
- div-class: add class to div tag
41+
- span-text-class: add class to span tag that contain button text
42+
- indicator-progress-class: add class to span tag that contain button progress indicator
43+
- loading-text: text that will be shown when button is loading
44+
- spinner-class: add class to span tag that contain button spinner
45+
- other attributes will be added to button tag
46+
47+
we support livewire loading state, so if you use livewire you can use loading state like this:
48+
```html
49+
<x-template-components::button wire:target="save" />
50+
```
51+
3552
## Supported Templates
3653

3754
- [Vuexy](https://pixinvent.com/demo/vuexy-html-bootstrap-admin-template/html/ltr/vertical-menu-template/dashboard-ecommerce.html)

config/template-components.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
],
1313
'button' => [
1414
'button' => 'btn',
15-
'indicator-progress' => ' d-block',
16-
'spinner-class'
15+
'indicator-progress' => 'd-block',
16+
'spinner-class' => 'spinner-border spinner-border-sm',
1717
]
1818
],
1919
];

resources/views/components/button.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<button {{ $attributes->merge(['class' => config('template-components.defult_classes.button.button')]) }} {{ $attributes }} wire:loading.attr="disabled">
2-
<span wire:loading.remove wire:target="{{ $attributes->get('wire:target') }}" class="{{ $attributes->get('span-text') }}">
2+
<span wire:loading.remove wire:target="{{ $attributes->get('wire:target') }}" class="{{ $attributes->get('span-text-class') }}">
33
{{ $slot }}
44
</span>
55

0 commit comments

Comments
 (0)