Skip to content

Commit 9f35cd6

Browse files
committed
feat: modal component bs5
1 parent 123f16f commit 9f35cd6

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<div class="modal" tabindex="-1" id="{{ $attributes->get('id') ?: $id() }}">
2+
<div class="modal-dialog {{ $modalSizeClass ?? 'modal-lg' }}">
3+
<div class="modal-content">
4+
<div class="modal-header">
5+
<h5 class="modal-title">
6+
{{ $title ?? '' }}
7+
</h5>
8+
9+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
10+
</div>
11+
12+
<div class="modal-body">
13+
{{ $slot }}
14+
</div>
15+
16+
<div class="modal-footer">
17+
{{ $footer ?? '' }}
18+
</div>
19+
</div>
20+
</div>
21+
</div>

src/Views/Components/Modal.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,23 @@ class Modal extends Component
77
protected string $view = 'modal';
88

99
public string $title;
10+
public ?string $modalSizeClass = null;
1011

1112
/**
1213
* Create a new component instance.
1314
*
1415
* @return void
1516
*/
1617
public function __construct(
18+
string $id = '',
1719
string $title = '',
20+
string $modalSizeClass = null,
1821
string $framework = ''
1922
) {
2023
parent::__construct($framework);
2124

25+
$this->id = $id;
2226
$this->title = $title;
27+
$this->modalSizeClass = $modalSizeClass;
2328
}
2429
}

0 commit comments

Comments
 (0)