Alert
Set up
Import Alert, BorderAlert, and InfoAlert and set variables in the script tag.
<script>
import { Alert } from "flowbite-svelte";
</script>
Alert examples
<Alert alertId="alert-blue">
A simple info alert without a close button.
</Alert>
<Alert alertId="alert-gray" color="gray" closeBtn>
A simple info alert with a close button.
</Alert>
<Alert alertId="alert-green" color="green" closeBtn>
A simple info alert with a close button.
</Alert>
<Alert alertId="alert-red" color="red" closeBtn>
A simple info alert with a close button.
</Alert>
<Alert alertId="alert-purple" color="purple" closeBtn>
A simple info alert with a close button.
</Alert>
<Alert alertId="alert-yellow" color="yellow" closeBtn>
A simple info alert with a close button.
</Alert>
<Alert alertId="alert-indigo" color="indigo" closeBtn>
A simple info alert with a close button.
</Alert>
<Alert alertId="alert-pink" color="pink" closeBtn>
A simple info alert with a close button.
</Alert>
A simple info alert without a close button.
A simple info alert with a close button.
A simple info alert with a close button.
A simple info alert with a close button.
A simple info alert with a close button.
A simple info alert with a close button.
A simple info alert with a close button.
A simple info alert with a close button.
Props
The component has the following props, type, and default values. See type-list page for type information.
Name | Type | Default |
---|---|---|
color | Colors | 'blue' |
alertId | string | number | 'alert-1' |
closeBtn | boolean | false |
btn1 | boolean | false |