Alert
Default Alert
Default alert! Change a few things up and try submitting again.
Info alert! Change a few things up and try submitting again.
Danger alert! Change a few things up and try submitting again.
Success alert! Change a few things up and try submitting again.
Warning alert! Change a few things up and try submitting again.
Dark alert! Change a few things up and try submitting again.
<script lang="ts">
import { Alert } from "flowbite-svelte";
</script>
<Alert>
<span class="font-medium">Default alert!</span>
Change a few things up and try submitting again.
</Alert>
<Alert color="blue">
<span class="font-medium">Info alert!</span>
Change a few things up and try submitting again.
</Alert>
<Alert color="red">
<span class="font-medium">Danger alert!</span>
Change a few things up and try submitting again.
</Alert>
<Alert color="green">
<span class="font-medium">Success alert!</span>
Change a few things up and try submitting again.
</Alert>
<Alert color="yellow">
<span class="font-medium">Warning alert!</span>
Change a few things up and try submitting again.
</Alert>
<Alert color="secondary">
<span class="font-medium">Dark alert!</span>
Change a few things up and try submitting again.
</Alert>
Alert with Icon
Default alert! Change a few things up and try submitting again.
Info alert! Change a few things up and try submitting again.
Danger alert! Change a few things up and try submitting again.
Success alert! Change a few things up and try submitting again.
Warning alert! Change a few things up and try submitting again.
Dark alert! Change a few things up and try submitting again.
<script>
import { Alert } from "flowbite-svelte";
import { InfoCircleSolid } from "flowbite-svelte-icons";
</script>
<Alert>
{#snippet icon()}<InfoCircleSolid class="h-5 w-5" />{/snippet}
<span class="font-medium">Default alert!</span>
Change a few things up and try submitting again.
</Alert>
<Alert color="blue">
{#snippet icon()}<InfoCircleSolid class="h-5 w-5" />{/snippet}
<span class="font-medium">Info alert!</span>
Change a few things up and try submitting again.
</Alert>
<Alert color="red">
{#snippet icon()}<InfoCircleSolid class="h-5 w-5" />{/snippet}
<span class="font-medium">Danger alert!</span>
Change a few things up and try submitting again.
</Alert>
<Alert color="green">
{#snippet icon()}<InfoCircleSolid class="h-5 w-5" />{/snippet}
<span class="font-medium">Success alert!</span>
Change a few things up and try submitting again.
</Alert>
<Alert color="yellow">
{#snippet icon()}<InfoCircleSolid class="h-5 w-5" />{/snippet}
<span class="font-medium">Warning alert!</span>
Change a few things up and try submitting again.
</Alert>
<Alert color="secondary">
{#snippet icon()}<InfoCircleSolid class="h-5 w-5" />{/snippet}
<span class="font-medium">Dark alert!</span>
Change a few things up and try submitting again.
</Alert>
Bordered alerts
Default alert! Change a few things up and try submitting again.
Info alert! Change a few things up and try submitting again.
Danger alert! Change a few things up and try submitting again.
Success alert! Change a few things up and try submitting again.
Warning alert! Change a few things up and try submitting again.
Dark alert! Change a few things up and try submitting again.
<script>
import { Alert } from "flowbite-svelte";
import { InfoCircleSolid } from "flowbite-svelte-icons";
</script>
<Alert border>
{#snippet icon()}<InfoCircleSolid class="h-5 w-5" />{/snippet}
<span class="font-medium">Default alert!</span>
Change a few things up and try submitting again.
</Alert>
<Alert border color="blue">
{#snippet icon()}<InfoCircleSolid class="h-5 w-5" />{/snippet}
<span class="font-medium">Info alert!</span>
Change a few things up and try submitting again.
</Alert>
<Alert border color="red">
{#snippet icon()}<InfoCircleSolid class="h-5 w-5" />{/snippet}
<span class="font-medium">Danger alert!</span>
Change a few things up and try submitting again.
</Alert>
<Alert border color="green">
{#snippet icon()}<InfoCircleSolid class="h-5 w-5" />{/snippet}
<span class="font-medium">Success alert!</span>
Change a few things up and try submitting again.
</Alert>
<Alert border color="yellow">
{#snippet icon()}<InfoCircleSolid class="h-5 w-5" />{/snippet}
<span class="font-medium">Warning alert!</span>
Change a few things up and try submitting again.
</Alert>
<Alert border color="secondary">
{#snippet icon()}<InfoCircleSolid class="h-5 w-5" />{/snippet}
<span class="font-medium">Dark alert!</span>
Change a few things up and try submitting again.
</Alert>
Alert with list
Info
Ensure that these requirements are met:
- At least 10 characters (and up to 100 characters)
- At least one lowercase character
- Inclusion of at least one special character, e.g., ! @ # ?
Info
Ensure that these requirements are met:
- At least 10 characters (and up to 100 characters)
- At least one lowercase character
- Inclusion of at least one special character, e.g., ! @ # ?
<script>
import { Alert, Li, List } from "flowbite-svelte";
import { InfoCircleSolid } from "flowbite-svelte-icons";
</script>
<Alert class="items-start!">
{#snippet icon()}<span>
<InfoCircleSolid class="h-5 w-5" />
<span class="sr-only">Info</span>
</span>
{/snippet}
<p class="font-medium">Ensure that these requirements are met:</p>
<ul class="ms-4 mt-1.5 list-inside list-disc">
<li>At least 10 characters (and up to 100 characters)</li>
<li>At least one lowercase character</li>
<li>Inclusion of at least one special character, e.g., ! @ # ?</li>
</ul>
</Alert>
<Alert color="blue" class="items-start!">
{#snippet icon()}<span>
<InfoCircleSolid class="h-5 w-5" />
<span class="sr-only">Info</span>
</span>
{/snippet}
<p class="font-medium">Ensure that these requirements are met:</p>
<List class="ms-4 mt-1.5">
<Li>At least 10 characters (and up to 100 characters)</Li>
<Li>At least one lowercase character</Li>
<Li>Inclusion of at least one special character, e.g., ! @ # ?</Li>
</List>
</Alert>
Dismissable Alert
A simple default alert with an example link . Give it a click if you like.
A simple info alert with an example link . Give it a click if you like.
A simple info alert with an example link . Give it a click if you like.
A simple info alert with an example link . Give it a click if you like.
An alert with non default animation - fly away.
An alert with the custom dismissal button. slot
<script>
import { Alert } from "flowbite-svelte";
import { InfoCircleSolid, EnvelopeSolid } from "flowbite-svelte-icons";
import { fly } from "svelte/transition";
</script>
<Alert dismissable>
{#snippet icon()}<InfoCircleSolid class="h-5 w-5" />{/snippet}
A simple default alert with an
<a href="/" class="font-semibold underline hover:text-blue-800 dark:hover:text-blue-900">example link</a>
. Give it a click if you like.
</Alert>
<Alert color="blue" dismissable>
{#snippet icon()}<InfoCircleSolid class="h-5 w-5" />{/snippet}
A simple info alert with an
<a href="/" class="font-semibold underline hover:text-blue-800 dark:hover:text-blue-900">example link</a>
. Give it a click if you like.
</Alert>
<Alert color="red" dismissable>
{#snippet icon()}<InfoCircleSolid class="h-5 w-5" />{/snippet}
A simple info alert with an
<a href="/" class="font-semibold underline hover:text-red-800 dark:hover:text-red-900">example link</a>
. Give it a click if you like.
</Alert>
<Alert color="green" dismissable>
{#snippet icon()}<InfoCircleSolid class="h-5 w-5" />{/snippet}
A simple info alert with an
<a href="/" class="font-semibold underline hover:text-green-800 dark:hover:text-green-900">example link</a>
. Give it a click if you like.
</Alert>
<Alert color="yellow" dismissable transition={fly} params={{ x: 200 }}>
{#snippet icon()}<InfoCircleSolid class="h-5 w-5" />{/snippet}
An alert with non default animation - fly away.
</Alert>
<Alert color="purple" dismissable closeIcon={EnvelopeSolid}>
{#snippet icon()}<InfoCircleSolid class="h-5 w-5" />{/snippet}
An alert with the custom dismissal button. slot
</Alert>
Border Accent
Info alert! Change a few things up and try submitting again.
Danger alert! Change a few things up and try submitting again.
Success alert! Change a few things up and try submitting again.
Warning alert! Change a few things up and try submitting again.
Dark alert! Change a few things up and try submitting again.
<script>
import { Alert } from "flowbite-svelte";
import { InfoCircleSolid } from "flowbite-svelte-icons";
</script>
<Alert rounded={false} class="border-t-4">
{#snippet icon()}<InfoCircleSolid class="h-5 w-5" />{/snippet}
<span class="font-medium">Info alert!</span>
Change a few things up and try submitting again.
</Alert>
<Alert color="red" rounded={false} class="border-t-4">
{#snippet icon()}<InfoCircleSolid class="h-5 w-5" />{/snippet}
<span class="font-medium">Danger alert!</span>
Change a few things up and try submitting again.
</Alert>
<Alert color="green" rounded={false} class="border-t-4">
{#snippet icon()}<InfoCircleSolid class="h-5 w-5" />{/snippet}
<span class="font-medium">Success alert!</span>
Change a few things up and try submitting again.
</Alert>
<Alert color="yellow" rounded={false} class="border-t-4">
{#snippet icon()}<InfoCircleSolid class="h-5 w-5" />{/snippet}
<span class="font-medium">Warning alert!</span>
Change a few things up and try submitting again.
</Alert>
<Alert color="secondary" rounded={false} class="flex-row-reverse border-t-4">
{#snippet icon()}<InfoCircleSolid class="h-5 w-5" />{/snippet}
<span class="font-medium">Dark alert!</span>
Change a few things up and try submitting again.
</Alert>
Additional content
This is a info alert
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.
This is a info alert
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.
<script>
import { Alert, Button } from "flowbite-svelte";
import { InfoCircleSolid, EyeSolid } from "flowbite-svelte-icons";
</script>
<Alert>
<div class="flex items-center gap-3">
<InfoCircleSolid class="h-5 w-5" />
<span class="text-lg font-medium">This is a info alert</span>
</div>
<p class="mt-2 mb-4 text-sm">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.</p>
<div class="flex gap-2">
<Button size="xs"><EyeSolid class="me-2 h-4 w-4" />View more</Button>
<Button size="xs" outline>Go to Home</Button>
</div>
</Alert>
<Alert color="green">
<div class="flex items-center gap-3">
<InfoCircleSolid class="h-5 w-5" />
<span class="text-lg font-medium">This is a info alert</span>
</div>
<p class="mt-2 mb-4 text-sm">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.</p>
<div class="flex gap-2">
<Button size="xs" color="green"><EyeSolid class="me-2 h-4 w-4" />View more</Button>
<Button size="xs" outline color="green">Go to Home</Button>
</div>
</Alert>
Custom color
Your content
<script lang="ts">
import { Alert } from "flowbite-svelte";
</script>
<Alert class="bg-sky-500 text-white">Your content</Alert>
Event
Close me
<script>
import { Alert } from "flowbite-svelte";
let alertStatus = $state(true);
const closeAlert = () => {
alert("Clicked closeAlert.");
alertStatus = !alertStatus;
};
</script>
<Alert dismissable onclick={closeAlert} bind:alertStatus>Close me</Alert>