Skip to content

Commit e4b01f0

Browse files
committed
2 parents a88b9f2 + e4ca7b1 commit e4b01f0

File tree

3 files changed

+41
-3
lines changed

3 files changed

+41
-3
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ php artisan laravel-template-components:install
2323

2424
## Usage
2525

26-
### Input component
26+
### Input Component
2727
```html
2828
<x-template-components::input />
2929
```
@@ -32,7 +32,7 @@ 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
35+
### Button Component
3636
```html
3737
<x-template-components::button />
3838
```
@@ -49,7 +49,7 @@ we support livewire loading state, so if you use livewire you can use loading st
4949
<x-template-components::button wire:target="save" />
5050
```
5151

52-
### Select component
52+
### Select Component
5353
```html
5454
<x-template-components::select>
5555
<option value="1">option 1</option>
@@ -61,6 +61,15 @@ He accept all normal attributes of select tag and add some new attributes:
6161
- label-class: add class to label tag
6262
- other attributes will be added to select tag
6363

64+
### Textarea Component
65+
```html
66+
<x-template-components::textarea />
67+
```
68+
He accept all normal attributes of textarea tag and add some new attributes:
69+
- div-class: add class to div tag
70+
- label-class: add class to label tag
71+
- other attributes will be added to textarea tag
72+
6473
## Supported Templates
6574

6675
- [Vuexy](https://pixinvent.com/demo/vuexy-html-bootstrap-admin-template/html/ltr/vertical-menu-template/dashboard-ecommerce.html)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<div class="{{ config('template-components.defult_classes.input.div') }} {{ $attributes->get('div-class') }}">
2+
3+
<label class="{{ config('template-components.defult_classes.input.label') }} {{ $attributes->get('label-class') }}">
4+
{{ $attributes->get('label') }}
5+
</label>
6+
7+
<textarea class="{{ config('template-components.defult_classes.input.input') }} {{ $attributes->get('class') }}
8+
@error($attributes->get('name') ?? $attributes->whereStartsWith('wire:model')->first())
9+
{{ config('template-components.defult_classes.input.input-error') }}
10+
@enderror"
11+
{{ $attributes }}>
12+
{{ $slot }}
13+
</textarea>
14+
15+
@error($attributes->get('name') ?? $attributes->whereStartsWith('wire:model')->first())
16+
<div class="{{ config('template-components.defult_classes.input.error-div') }}">
17+
{{ $message }}
18+
</div>
19+
@enderror
20+
</div>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
// test textarea component
4+
5+
use Illuminate\Support\Facades\View;
6+
7+
it('can render textarea component', function () {
8+
$this->assertTrue(View::exists('template-components::textarea'));
9+
});

0 commit comments

Comments
 (0)