Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d8aa84c

Browse files
authoredMay 6, 2025
refactor: alert examples updated to use FwbButton
Refactor alert examples to use `FwbButton`
2 parents f94020a + bf72c90 commit d8aa84c

File tree

2 files changed

+44
-36
lines changed

2 files changed

+44
-36
lines changed
 

‎docs/components/alert.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -227,37 +227,40 @@ The following alert components can be used if you wish to disclose more informat
227227
More info about this info alert goes here. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.
228228
</div>
229229
<div class="flex">
230-
<button
231-
type="button"
232-
class="text-white bg-blue-800 hover:bg-blue-900 focus:ring-4 focus:outline-none focus:ring-blue-200 font-medium rounded-lg text-xs px-3 py-1.5 mr-2 text-center inline-flex items-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
230+
<fwb-button
231+
color="blue"
232+
size="sm"
233+
class="mr-2 inline-flex items-center"
233234
>
234-
<svg
235-
class="-ml-0.5 mr-2 h-3 w-3"
236-
aria-hidden="true"
237-
xmlns="http://www.w3.org/2000/svg"
238-
fill="currentColor"
239-
viewBox="0 0 20 14"
240-
>
241-
<path d="M10 0C4.612 0 0 5.336 0 7c0 1.742 3.546 7 10 7 6.454 0 10-5.258 10-7 0-1.664-4.612-7-10-7Zm0 10a3 3 0 1 1 0-6 3 3 0 0 1 0 6Z" />
242-
</svg>
235+
<template #prefix>
236+
<svg
237+
class="size-3"
238+
aria-hidden="true"
239+
xmlns="http://www.w3.org/2000/svg"
240+
fill="currentColor"
241+
viewBox="0 0 20 14"
242+
>
243+
<path d="M10 0C4.612 0 0 5.336 0 7c0 1.742 3.546 7 10 7 6.454 0 10-5.258 10-7 0-1.664-4.612-7-10-7Zm0 10a3 3 0 1 1 0-6 3 3 0 0 1 0 6Z" />
244+
</svg>
245+
</template>
243246
View more
244-
</button>
245-
<button
246-
type="button"
247-
class="text-blue-800 bg-transparent border border-blue-800 hover:bg-blue-900 hover:text-white focus:ring-4 focus:outline-none focus:ring-blue-200 font-medium rounded-lg text-xs px-3 py-1.5 text-center dark:hover:bg-blue-600 dark:border-blue-600 dark:text-blue-400 dark:hover:text-white dark:focus:ring-blue-800"
247+
</fwb-button>
248+
<fwb-button
249+
size="sm"
250+
outline
248251
data-dismiss-target="#alert-additional-content-1"
249252
aria-label="Close"
250253
@click="onCloseClick"
251254
>
252255
Dismiss
253-
</button>
256+
</fwb-button>
254257
</div>
255258
</template>
256259
</fwb-alert>
257260
</template>
258261
259262
<script setup>
260-
import { FwbAlert } from 'flowbite-vue'
263+
import { FwbAlert, FwbButton } from 'flowbite-vue'
261264
</script>
262265
```
263266

‎docs/components/alert/examples/FwbAlertExampleCustomContent.vue

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,36 +23,41 @@
2323
More info about this info alert goes here. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.
2424
</div>
2525
<div class="flex">
26-
<button
27-
type="button"
28-
class="mr-2 inline-flex items-center rounded-lg bg-blue-800 px-3 py-1.5 text-center text-xs font-medium text-white hover:bg-blue-900 focus:outline-none focus:ring-4 focus:ring-blue-200 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
26+
<fwb-button
27+
color="blue"
28+
size="sm"
29+
class="mr-2 inline-flex items-center"
2930
>
30-
<svg
31-
class="-ml-0.5 mr-2 size-3"
32-
aria-hidden="true"
33-
xmlns="http://www.w3.org/2000/svg"
34-
fill="currentColor"
35-
viewBox="0 0 20 14"
36-
>
37-
<path d="M10 0C4.612 0 0 5.336 0 7c0 1.742 3.546 7 10 7 6.454 0 10-5.258 10-7 0-1.664-4.612-7-10-7Zm0 10a3 3 0 1 1 0-6 3 3 0 0 1 0 6Z" />
38-
</svg>
31+
<template #prefix>
32+
<svg
33+
class="size-3"
34+
aria-hidden="true"
35+
xmlns="http://www.w3.org/2000/svg"
36+
fill="currentColor"
37+
viewBox="0 0 20 14"
38+
>
39+
<path
40+
d="M10 0C4.612 0 0 5.336 0 7c0 1.742 3.546 7 10 7 6.454 0 10-5.258 10-7 0-1.664-4.612-7-10-7Zm0 10a3 3 0 1 1 0-6 3 3 0 0 1 0 6Z"
41+
/>
42+
</svg>
43+
</template>
3944
View more
40-
</button>
41-
<button
42-
type="button"
43-
class="rounded-lg border border-blue-800 bg-transparent px-3 py-1.5 text-center text-xs font-medium text-blue-800 hover:bg-blue-900 hover:text-white focus:outline-none focus:ring-4 focus:ring-blue-200 dark:border-blue-600 dark:text-blue-400 dark:hover:bg-blue-600 dark:hover:text-white dark:focus:ring-blue-800"
45+
</fwb-button>
46+
<fwb-button
47+
size="sm"
48+
outline
4449
data-dismiss-target="#alert-additional-content-1"
4550
aria-label="Close"
4651
@click="onCloseClick"
4752
>
4853
Dismiss
49-
</button>
54+
</fwb-button>
5055
</div>
5156
</template>
5257
</fwb-alert>
5358
</div>
5459
</template>
5560

5661
<script lang="ts" setup>
57-
import { FwbAlert } from '../../../../src/index'
62+
import { FwbAlert, FwbButton } from '../../../../src/index'
5863
</script>

0 commit comments

Comments
 (0)