aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/twbs/bootstrap/site/layouts/shortcodes/js-dismiss.html
blob: 45d72d0eb28c1c55ea60328feaf30aba4212073c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{{- /* Usage: js-dismiss "ComponentName" */ -}}

{{- $name := .Get 0 -}}

Dismissal can be achieved with the `data` attribute on a button **within the {{ $name }}** as demonstrated below:

```html
<button type="button" class="btn-close" data-bs-dismiss="{{ $name }}" aria-label="Close"></button>
```

or on a button **outside the {{ $name }}** using the `data-bs-target` as demonstrated below:

```html
<button type="button" class="btn-close" data-bs-dismiss="{{ $name }}" data-bs-target="#my-{{ $name }}" aria-label="Close"></button>
```